How do I create sub-applications in Django?
Solution 1:
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.
Solution 2:
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:
- Create
sub_app1
directory inapp
directory python manage.py startapp sub_app1 app/sub_app1