$ django-admin.py startproject PROJECT
$ cd PROJECT
$ python manage.py startapp
is simply not cutting it. $ django-admin.py startproject PROJECT
$ cd PROJECT
$ python manage.py startapp
is simply not cutting it.(What worked at the paper has always worked well for me, of course, but I've never been too adventurous about straying.)
$ django-admin.py startproject testo
$ cd testo
$ ./manage.py startapp testapp
$ tree
.
├── manage.py
├── testapp
│ ├── __init__.py
│ ├── models.py
│ ├── tests.py
│ └── views.py
└── testo
├── __init__.py
├── settings.py
├── urls.py
└── wsgi.pyIn Ruby, for instance, you really need conventions as in Ruby the concept of packages and how they get included / used is a lot more relaxed.
In Python tests.py is a package as far as Python is concerned. If it gets too big you can make it a directory and break its contents in several sub-packages. I did this with everything else too, like views.py or models.py
The one concept Django has that I consider a flaw is in fact non-pythonic - apps. That's because apps are not just simple packages. Instead apps are packages that have to be specified in an INSTALLED_APPS constant in a top-level "settings" package. This makes using parts of Django in scripts a PITA, as your script needs an accompanying settings file. Also, apps are not properly defined either and in some instances an app must have a "models" subpackage (or at least this used to be the case).
Did I just make that up?