« Post a day in review | Year in Review »
During the last month I have proposed some conventions for Django, mostly in the realm of templates. In doing so I have looked around for other documented places where conventions are mentioned. I haven't found a really good reference for Django conventions. Brian's post was a good example of reusable app conventions, and the Pinax Project is a great reference implementation. However, I couldn't find any simple reference for regularly used conventions in the Django world.
I don't know if this will be useful for people, but I think this goes along the whole convention/pattern ideal. If we all use a common naming, syntax, and style in places where they can be arbitrary, then we gain a lot of value of being able to understand whats going on in others code. So I have started a project that hopefully will act as a reference for Django Conventions.
Currently it is pretty sparse, but I think that having that document in any form is a great step. I'd love to hear some feedback, and it needs a lot of work, so feel free to email me or leave comments here with your additions and criticisms. If this idea becomes useful, I would be fully in support of including it in the Django Documentation or something along those lines as well, but I don't know how "official" this will really be. For the moment just consider it my hair brained idea of how things should be done :) Cheers.
Comments have been close for this post.
Posted at 10:45 p.m. on December 3, 2008
Comments: 3
Tags: conventions , django , idea , project
Large Problems in Django, Mostly Solved: Delayed Execution
1 month Ago (Comments: 10)
Django Inspect: A generic introspection API for Django models
5 months, 2 weeks Ago (Comments: 7)
The role of designers in the Django community
5 months, 3 weeks Ago (Comments: 23)
Large Problems in Django, Mostly Solved: Documentation
5 months, 3 weeks Ago (Comments: 7)
6 months, 3 weeks Ago (Comments: 0)
I may not have gone where I intended to go, but I think I have ended up where I intended to be.
- Douglas Adams


Comments
1 Malcolm Tredinnick says...
A number of these look useful, some will be slightly arbitrary and some need better phrasing (e.g. models.py and views.py assumes I would only ever have one file for those. They can be modules). However, that's all small fry.
You should probably avoid reinventing a coding style, though, and contributing.txt in the Django documentation already has a preferred ordering. Matching what Django does is probably not a bad idea in that respect. You more or less mimic that already, but putting a link in for all the cases wouldn't be a bad idea.
Posted at 5:56 a.m. on December 4, 2008
2 Camron Flanders says...
A page in the wiki on djangoproject.com seems a more appropriate place for this.
Posted at 3:53 p.m. on December 6, 2008
3 Preston Holmes says...
Wherever it lives, here or wiki - this is great for people just starting (like me) to develop good habits early.
Posted at 7 p.m. on December 19, 2008