Hacker News new | past | comments | ask | show | jobs | submit login

Creating a single project wide middleware / context processor file doesn't make sense - each application should provide specific functionality to the project don't group it into a single middleware or context processor.

Look at the django.contrib applications. They are perfect examples of how you should structure your apps. The authentication middleware is in django.contrib.auth. etc.

If you are automatically deleting models.py, views.py, forms.py your doing it all wrong - rarely should an application get large enough to require these changes to application structure in django.

Again django.contrib.admin is the only application that has a views/ directory because it has so many permutations to make generic functionality available to most users.

One thing I would like to add is that I think django-admin.py for projects should create the templates directory and static directory when starting a project. It should also generate forms.py, urls.py (not mentioned in the article) and a templates directory for apps.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: