Django Best Practices
This post got a bit long-winded, skip to the project announcment if you prefer.
One of the things I love about Python and Django is the philosophy that there is one obvious way to do things. Standards make it easy to dive into other people’s code and figure out what is going on pretty quickly. As with anything under active development, however, those standards are subject to change over time. What was best practice for building sites with Django 0.91 is significantly different than building sites with Django 1.0. Better tools and more experience allow us to refine our processes over time into a set of best practices. While both Python and Django are very well documented, much of the experience and wisdom that is outside the scope of the official documentation is not.
Blogs are Bad for Documentation
Most of this information lives scattered across blogs, mailing lists, books, and the IRC channel. None of these avenues make it easy for developers to learn how to do things the “one obvious way.” There is a lot of stale information floating around out there, some of which we are guilty of creating. We try to blog about how we write and deploy code at Lincoln Loop, but like everyone else out there, we’re utilizing new tools and techniques on a regular basis. Our posts become outdated, but still get lots of hits from users searching for answers. Blogs and mailing lists are great for getting the word out there, but they aren’t true documentation of our growing ecosystem. What’s really needed is a living document.
Sphinx is Good for Documentation
Thankfully, Eric Holscher and Brian Rosner’s Reusable App Docs project got the ball rolling on creating this documentation. It’s focused on giving Django developers a comprehensive manual for building reusable Django applications. Better yet, it is open source and can be generated into any number of formats using the amazing Sphinx documentation generator.
Scratching the Itch
Our team has grown recently and it was important to us that everyone here develop using the same technique and style. Our intranet pointed to Eric and Brian’s project, but quickly started expanding on it. Without realizing it, we created documentation on Django best practices and realized we shouldn’t keep it hidden. I spoke to Eric about forking the project and expanding upon it since our scope was outside of the original documentation he and Brian created. With his blessing we started django-best-practices at GitHub. We’ve started some brain dumps into the document already and hope to chip away at it over time.
p(#the-goods). You can find a live copy of Django Best Practices at http://lincolnloop.com/django-best-practices/. We’ll still blog about new tips and tricks, but link those posts to the live document so people can always get up-to-date information. If you’re interested in following our progress, you can also follow the project feed.
Comments
Got something to say?
Our Products
Categories
- accessiblity
- code
- company news
- django
- gondola
- open source
- portfolio
- presentation
- pro tip
- review
- screencast
- seo
- software
- subversion
- trailmapping
- wordpress
Archives
- February, 2010
- December, 2009
- November, 2009
- October, 2009
- September, 2009
- June, 2009
- April, 2009
- February, 2009
Elsewhere
What we’ve been up to online
-
pushed to master at lincolnloop/django-geotagging
Pete, 0 minutes ago -
Tips for remote workers: +1 for using your VCS/Issue Tracker to keep everyone in the loop efficiently http://bit.ly/bYjJNv
Pete, 0 minutes ago -
Lots of love for the Django community in the latest @nasuni blog post http://bit.ly/dkrVk5
Pete, 0 minutes ago -
4 simple tips for wannabe remote workers « Fetchez le Python
Tips for remote workers: +1 for using your VCS/Issue Tracker to keep everyone in the loop efficiently
Pete, 0 minutes ago -
Django on AppEngine has come a long way. I'm watching a local management command populate my GAE datastore. Great work @wkornewald
Pete, 5 days, 16 hours ago -
Oh noes! Our venerable @cmheisel is moving on to greener pastures. Help us find a new Project Manager! http://bit.ly/9tjgPx
Pete, 5 days, 23 hours ago -
pushed to master at lincolnloop/django-startproject
Pete, 6 days, 19 hours ago -
pushed to master at lincolnloop/django-redmine
Pete, 1 week, 1 day ago -
pushed to master at lincolnloop/django-redmine
Pete, 1 week, 1 day ago -
pushed to master at lincolnloop/django-redmine
Pete, 1 week, 1 day ago -
pushed to master at lincolnloop/django-redmine
Pete, 1 week, 1 day ago -
added cmheisel to django-redmine
Pete, 1 week, 1 day ago -
started following cmheisel
Pete, 1 week, 1 day ago -
created branch master at lincolnloop/django-redmine
Pete, 1 week, 1 day ago -
created repository redpiston
Pete, 1 week, 1 day ago


Great idea!
Adding comments to Best Practices would be great. Or any other feedback mechanism (like one in django book or similar).
Thank you
+1
for Nick.
How do you configure the Apache backend? I’d be very interested to know the bits with virtualenv.
I can’t see any PROJECT/apps directory – the one the Reusable App Docs project uses. Does it mean you actually install all your project applications? By project applications I mean all the applications specific to your project, and by installing I mean installing into the virtualenv.
Thank you
Yes, Django has really great design philosophy that saves a lot of time.
Thanks for the feedback all. Comments are now enabled via Disqus.
I’ve been able to build the document in HTML, using Sphinx, but get an error when trying to build the PDF version :
Could not import extension rst2pdf.pdfbuilder (exception: cannot import name PDFPageLabel)
I have installed rst2pdf itself.
@Derek
You should use Sphinx to build to PDF as well (via LaTeX as an intermediary). You may find this info helpful: http://jimmyg.org/blog/2009/sphinx-pdf-generation-with-latex.html