Skip to content
natea edited this page Sep 9, 2011 · 10 revisions

So you've setup python and django locally, gone through a tutorial and created a django application. Next you will deploy your site to a public server so you can show your mom :) No matter what OS you're running, the strategy around deploying your site includes three basic steps:

Deploy locally to a staging environment

The first thing you will want to do is replicate your server environment locally. You'll do this by setting up a virtual environment using e.g. VMWare or VirtualBox.

test

Links to testing methodologies should go here.

Deploy to Production Server

Once you are satisfied with your app you will want to deploy to your server. Use fabric to automate the deployment from your staging to production server.

Fabric

Fabric http://fabfile.org

Django deployment with Fabric (slides from a presentation) http://www.slideshare.net/lemonad/django-deployment-with-fabric

Fabfile for deploying djangoproject.com https://github.com/django/djangoproject.com/blob/master/fabfile.py

FabulAWS - A Python tool for creating and interacting with ephemeral Amazon Web Services (AWS) resources https://github.com/caktus/fabulaws

Silk is a Fabric-based tool for deploying WSGI apps on an Ubuntu/Nginx/Supervisord/Gunicorn stack. http://pypi.python.org/pypi/silk-deployment/

django-fab-deploy - A collection of Fabric scripts for deploying and managing django projects on Debian/Ubuntu servers using virtualenv, pip, nginx and apache with mod_wsgi. http://pypi.python.org/pypi/django-fab-deploy

http://github.com/lincolnloop/django-startproject/blob/master/django_startproject/project_template/fabfile.py http://github.com/lincolnloop/fab-pave/blob/ubuntu-8.04/fabfile.py http://www.caktusgroup.com/blog/2010/04/22/basic-django-deployment-with-virtualenv-fabric-pip-and-rsync/ http://lethain.com/entry/2008/nov/04/deploying-django-with-fabric/ http://vlent.nl/weblog/2010/09/27/fabric-easy-deployment/

http://www.clemesha.org/blog/modern-python-hacker-tools-virtualenv-fabric-pip

Good article about using Fabric to deploy Django to production/staging http://blog.apps.chicagotribune.com/2010/02/10/refactoring-fabric/

Django Deployment Workshop

Jacob Kaplan Moss’ Django Deployment Workshop http://github.com/jacobian/django-deployment-workshop

Video - http://oreilly.com/catalog/0636920014089 (Jacob Kaplan Moss Django deployment workshop at OSCON is $99)

or free on blip.tv: http://pycon.blip.tv/file/3632436/

Amazon Web Services

CloudCommander (from the Chicago News Tribune) https://github.com/newsapps/cloud-commander

CloudCommander recipes https://github.com/newsapps/cloud-commander-recipes

Provisioning a new Ubuntu server for Django http://brandonkonkle.com/blog/2010/jun/25/provisioning-new-ubuntu-server-django/

Chef

Building a Django stack with Chef http://help.opscode.com/kb/otherhelp/build-a-django-stack

Noah's (aka coderanger) cookbooks for using Chef to deploy Packaginator, a Django-based project https://github.com/coderanger/djangocon2011

Clone this wiki locally