_/_/_/ _/ _/ _/_/ _/ _/ _/_/ _/_/_/ _/_/_/ _/_/ _/ _/ _/ _/ _/ _/ _/_/_/_/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/_/ _/_/_/ _/ _/ _/ _/ _/ _/ _/ _/ _/_/_/_/
A Fabric deployment strategy for Python web applications.
Denim has been primarily developed to support Django web applications, deployed to Debian GNU/Linux (and derivative) platforms. With tools to support nginx, supervisor, virtual env, gunicorn, pip etc.
Designed to provide a rich tool-set built on top of and working with the existing functionality provided by Fabric. Get up and running quickly with the default deployment strategy.
The default strategy
The default strategy describes a project layout and deployment structure for Django applications that lets you deploy straight away
The strategy is designed to take a freshly deployed server and provision, deploy and activate your application, using best practices.
By default your application will run as the user webapps with a
shell and write access to limited parts of the filesystem. All code is owned by
Certain key variables are required to be set in the Fabric
these should be setup in your fabfile:
- The name of your project, this does not need to be Python compatible (ie you can use a dash '-').
- The name of the python package being deployed, this name is the name of your applications package folder (i.e. the django project name).
- The name of the environment you are deploying your application into, this is used to determine which configuration should be used. For example production, stage, uat.
These key variables will be used throughout this document.
|app||Application package deploy path|
|current||The current package version |
|revision/package_name||The revision and application package|
|bin||Binary folder |
|include||Include folder |
|lib||Lib folder |
|public||Public web root for web server|
|media||Application content or uploaded data |
|static||Static application content|
|var||Application variable data |
|/var/log/webapps/project_name/package_name||Project log path |
|||Symlink to the current revision.|
|||(1, 2, 3) Virtualenv created folders.|
|||(1, 2, 3) Writable by application user.|
|app||Application source root|
|package_name||Application package |
|deployment||Deployment settings folder|
|settings.*deploy_env*.py||Environment configuration |
|requirements.txt||PIP requirements file|
|init.d||Startup scripts for init.d|
|nginx.*deploy_env*.conf||Environment configuration |
|fabfile.py||Project fabric definition file|
|||(1, 2) Used to apply specific configuration based on deployment environment.|
|||This structure is based on Django 1.4.|