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 to get manage.py to do this for me.
Ideally I'll end up with a structure like:
project/ app/ subapp1/ subapp2/
I've tried manage.py startapp app.subapp1
and manage.py startapp app/subapp1
but this tells me that /
and .
are invalid characters for app names.
I've tried changing into the app directory and running ../manage.py subapp1
but that makes supapp1 at the top level. NOTE, I'm not trying to directly make a stand-alone application. I'm trying to do all this from within a project.
Django is famous for its unique and fully managed app structure. For every functionality, an app can be created like a completely independent module. This article will take you through how to create a basic app and add functionalities using that app.
A project refers to the entire application and all its parts. An app refers to a submodule of the project. It's self-sufficient and not intertwined with the other apps in the project such that, in theory, you could pick it up and plop it down into another project without any modification.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With