Back in February, I wrote a post titled 'Starting a Django Project the Right
Way',
which still draws a consistent audience eight months later. In those eight months,
Django has released version 1.4 of the framework, with 1.5 under active
development and promising experimental support for Python 3.x. Given these
changes, as well as the availability of new and updated resources available to
Django developers, I decided to revisit the concept of best practices when
starting a Django project.
The beginning of a project is a critical time. Choices are made that have long
term consequences. There are a number of tutorials about how to get started with
the Django framework, but few that discuss how to use Django in a professional
way, using industry accepted best practices to make sure your project development
scales as your application grows. A small bit of planning goes a long way
towards making your life easier in the future.
By the end of this post, you will have
- A fully functional Django 1.4 project
- All resources under source control (with git or Mercurial)
- Automated regression and unit testing (using the unittest library)
- An environment independent install of your project (using virtualenv)
- Automated deployment and testing (using Fabric)
- Automatic database migrations (using South)
- A development work flow that scales with your site.
None of these steps, except for perhaps the first, are covered in the
official tutorial. They should be. If you're looking to start a new,
production ready Django 1.4 project, look no further.
Read on →