Django 1.4專案開發

jieforest發表於2012-10-27
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 longway towards making your life easier in the future.

By the end of this post, you will have
1. A fully functional Django 1.4 project
2. All resources under source control (with git or Mercurial)
3. Automated regression and unit testing (using the unittest library)
4. An environment independent install of your project (using virtualenv)
5. Automated deployment and testing (using Fabric)
6. Automatic database migrations (using South)
7. 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.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/301743/viewspace-747346/,如需轉載,請註明出處,否則將追究法律責任。

相關文章