Monday, April 21, 2014

Interesting Django project folder structure.

Today I was reading through http://www.deploydjango.com/django_project_structure (great resource)

The suggested folder structure for a Django project from this site is like below:
(I'm only interested in layout for Django apps, not requirements files or settings files)

myproject      |-- manage.py
    |-- requriements.txt      |-- myproject          |-- __init__.py
        |-- settings.py          |-- urls.py          |-- wsgi.py
        |          `-- apps
            |-- __init__.py
            |-- app_one
            |   |-- __init__.py              |   |-- models.py              |   |-- views.py              |   `-- urls.py              `-- app_two                  |-- __init__.py                  |-- models.py                  |-- views.py                  `-- urls.py

My current setup is like below:

myproject      |-- manage.py
    |-- requirements.txt      |-- myproject      |   |-- __init__.py      |   |-- settings.py      |   |-- urls.py      |   `-- wsgi.py      `-- app_one      |   |-- __init__.py      |   |-- models.py      |   |-- views.py      |   `-- urls.py      `-- app_two          |-- __init__.py          |-- models.py          |-- views.py          `-- urls.py

The reason for the first layout is to categorise the apps, 
so one can have a "apps" folder contains all the custom apps;
"libs" folder contains all the lib/helper apps and such.

Do you guys think it's a good idea? 

Cheers

Tianyi  

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/37ecd6cb-6dcc-431e-ae39-3814dbf647de%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment