| Here's what I've found that helps tremendously: -Keep your software in a DVCS of some sort. I find Git and Mercurial to be great. -Use virtualenv to abstract away from your current environment's Python distribution. Start clean and download the packages you need. -Create a requirements file listing the packages that you need for you program. Put it in the same format that the 'pip freeze' command outputs, so that installing a new environment is quick and easy. -Set up a local configuration file (not managed by version control) and a base configuration file with all the settings that are immutable. Import the local config file within settings.py so as to avoid local setting conflicts. -In production, set up an nginx frontend to serve static files, and route all the Django urls to an Apache backend (or Tornado, or whichever App server you may want to use). -I haven't tried anything else, but WSGI is super intuitive and easy to use. -If you need it, try using Django-South for versioning database schemas. Do take into account that it has a bit of a learning curve. -You don't need to put your python files in /var/www, any directory will do. |
- We keep a local settings file for each environment, and those /are/ versioned. We have a /settings_local directory which contains each of the variants (localdev/dev/staging/df/live). The appropriate one is sym linked to /settings_local.py, which in turn is imported into settings.py.
- We bypass Apache entirely and just plug Nginx FCGI into Django directly.
- We have a separate pip requirements file for each environment (also kept in source control)
- We use a Puppet to configure our systems. Perosonally though, I have found Puppet to have an exceptionally steep learning curve, so you may want to shop around.
I hope that helps!