views:

714

answers:

6

I have tried following guides like this one but it just didnt work for me.

So my question is this: What is a good guide for deploying Django, and how do you deploy your Django.

I keep hearing that capastrano is pretty nifty to use, but i have no idea as to how to work it or what it does (apart from automation of deploying code), or even if i want/need to use it or not.

A: 

This looks like a good place to start: http://www.unessa.net/en/hoyci/2007/06/using-capistrano-deploy-django-apps/

Jim Burger
A: 

The easiest way would be to use one of the sites on http://djangofriendly.com/hosts/ that will provide the hosting and set up for you, but even if you're wanting to roll your own it will allow you to see what set up other sites are using.

Colin Barnes
+1  A: 

I have had success with mod_wsgi

Toni Ruža
+4  A: 

mod_wsgi in combination with a virtualenv for all the dependencies, a mercurial checkout into the virtualenv and a fabric recipe to check out the changes on the server.

I wrote an article about my usual workflow: Deploying Python Web Applications. Hope that helps.

Armin Ronacher
More detail on fabric: http://stackoverflow.com/questions/1233655/what-is-the-simplest-way-to-ssh-using-python
hughdbrown
+1 for mod_wsgi and virtualenv, would also recommend virtualenvwrapper, pip, and a pip requirements file for dealing with dependencies.
ken
+1  A: 

In my previous work we had real genius guy on deployment duties, he deployed application (Python, SQL, Perl and Java code) as set of deb files built for Ubuntu. Unfortunately now, I have no such support. We are deploying apps manually to virtualenv-ed environments with separate nginx configs for FastCGI. We use paver to deploy to remote servers. It's painful, but it works.

zgoda
A: 

I use mod_python, and have every site in a git repository with the following subdirs:

  • mysite
  • template
  • media

I have mysite/settings.py in .gitignore, and work like this:

  1. do development on my local machine
  2. create remote repository on webserver
  3. push my changes to webserver repo
  4. set up apache vhost config file, tweak live server settings.py
  5. run git checkout && git reset --hard && sudo /etc/init.d/apache2 restart on webserver repo to get up-to-date version to its working copy and restart apache
  6. repeat steps 1, 3 and 5 whenever change request comes
che