I\'m a Django newbie, but fairly experienced at programming. I have a set of related applications that I\'d like to group into a sub-application but can not figure out how t
Go to your apps folder. Try:
python ../manage.py startapp app_name
According to Django documentation,
If the optional destination is provided, Django will use that existing directory rather than creating a new one. You can use ‘.’ to denote the current working directory.
For example:
django-admin startapp myapp /Users/jezdez/Code/myapp
So, you can do it by this method:
sub_app1
directory in app
directorypython manage.py startapp sub_app1 app/sub_app1
django-admin.py startapp myapp /Users/jezdez/Code/myapp
Reference: Django Admin documentation
You can still do this :
cd app
django-admin startapp subapp1
This will work (create the application basic structure), however app
and subapp1
will still be considered as two unrelated applications in the sense that you have to add both of them to INSTALLED_APPS
in your settings.
Does this answer your question ? Otherwise you should tell more about what you are trying to do.
Django doesn't support "subapplications" per se. If you want code to be collected in packages within an app then just create them yourself. Otherwise you're just asking for pain.