tags:

views:

55

answers:

2

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
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.

+4  A: 

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.

Ignacio Vazquez-Abrams
+1  A: 

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.

sebpiq
This is how it's done, but usually the command is called `django-admin.py`. Also, in `INSTALLED_APPS` you will need to put `project.app` and `project.app.subapp1` etc.
Rob Golding
For some reason, with my version of django it is called `django-admin` without `.py`, but on some other computers, I have to use `django-admin.py`...
sebpiq