What really is the true meaning of django project and individual apps in it?
I mean - AFAIK you cannot create a project and live entirely in that project you created, you have to create an app in that project to be able to actually do something in django. Please correct me if I'm wrong.
Now what should really be the structure of a django project? I'm writing an e-shop. Let's say my project is named foo
:
/foo
/foo
/settings.py
/templates
/urls.py
/wsgi.py
/shop
/__init__.py
/admin.py
/models.py
/tests.py
/views.py
and do everything entirely in /foo/shop/
, but I edit urls.py
inside /foo/foo/
etc.
I was following the Django Book, but I've begun to gain that strange feeling that /foo/foo/
is just for a main folder "stitching the thing together" but individual stuff should be done only in /foo/shop/
, but not limited to. Preferably in /foo/web/
, /foo/products/
, /foo/forum/
, /foo/controlpanel/
, /foo/shop/
, /foo/helpdesk/
, /foo/backoffice/
etc.
Is that correct? Should I put everything products-related in /foo/products/
, that including storage management, shipping, dealers, prices etc., then put management of those products (from the employee side) to /foo/backoffice/
, which will serve as some sort of "django.contrib.admin
" for this? Is that correct? Then if I want to host multiple instances of this (with completely separate databases and stuff) for multiple customers, should i only create a barebone project, that will put these things together, to configure the settings and then just move individual components in some sort of central repository and call them back in the project via INSTALLED_APPS
? Because that would be cool as hell! I mean - making all the changes globally, not touching users data and configuration, unless necessary (adding columns in models and such). Is this how django is really supposed to be used? Or am I completely off the track and do things ENTIRELY wrong and this paragraph just doesn't make any django-sense?
I'm relatively new to this. I've been using PHP before and even though Django was a pain-in-the-ass to get basic grip of, I don't regret that and plan to deprecate and make offline any PHP project I created to date and replace them all with django. Well - where it makes sense and is not a single-purpose site. Not only because Django is awesome and versatile, but i cas I can scale it easily as well…
So… How should I really design Django projects, apps, and how to use them in production, providing them to multiple customers?
Thank you!