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
- July, 2010
- June, 2010
- May, 2010
- April, 2010
- February, 2010
- December, 2009
- November, 2009
- October, 2009
Elsewhere
What we’ve been up to online
-
Just launched a Flask/App Engine mini-site we've been tinkering on http://emailed-me.appspot.com/
Pete, 14 hours, 52 minutes ago -
created repository Emailed-Me-
Pete, 15 hours ago -
Our first iPhone development project hit the App Store last week and is already over 1k users! Check them out @takemyspot #iphone #geodjango
Pete, 3 weeks ago -
Love the new sites! RT @welikesmall: We just launched two new sites. http://post.ly/mGoq
Pete, 3 weeks, 1 day ago -
Pro tip: Using pip safely for automated deployment (no more pesky prompts) http://bit.ly/b5zsPa
Pete, 4 weeks, 1 day ago -
commented on justquick/django-mailfriend
Pete, 1 month ago -
RT @unbracketed: Excited to have @mitsuhiko joining us for some work this summer :)
Pete, 1 month ago -
New blog post: managing supervisord with upstart http://bit.ly/db3p5N
Pete, 1 month ago -
Troubleshooting OpenID is just like user/password. Except you have 5 of them and and you don't know which one is failing, and 3 login pages
Pete, 1 month, 1 week ago -
This gets very interesting around 42 min. Using javascript to snoop inside firewalled networks http://bit.ly/aNVPc5
Pete, 1 month, 2 weeks ago -
The final tally is in. 8 Lincoln Loopers attending DjangoCon. 3 US, 4 EU, and 1 NZ. Looking forward to it!
Pete, 1 month, 2 weeks ago -
Twitter / Dustin Curtis: I'm flying to Madrid tomor ...
Dustin Curtis travels to Berlin, Bangkok & Madrid in exchange for design services as the result of a late night tweet.
Pete, 1 month, 2 weeks ago -
created branch ubuntu-8.04 at lincolnloop/fab-pave
Pete, 1 month, 3 weeks ago -
created repository fab-pave
Pete, 1 month, 3 weeks ago -
pushed to master at lincolnloop/django-mailfriend
Pete, 1 month, 3 weeks 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