11

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.

Jérôme Verstrynge
  • 57,710
  • 92
  • 283
  • 453
Josh Hunt
  • 14,225
  • 26
  • 79
  • 98

6 Answers6

7

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.

JMM
  • 536
  • 2
  • 8
Armin Ronacher
  • 31,998
  • 13
  • 65
  • 69
  • More detail on fabric: http://stackoverflow.com/questions/1233655/what-is-the-simplest-way-to-ssh-using-python – hughdbrown Aug 05 '09 at 15:13
  • 1
    +1 for mod_wsgi and virtualenv, would also recommend virtualenvwrapper, pip, and a pip requirements file for dealing with dependencies. – ken Aug 07 '09 at 01:17
  • I second the request for a link update, please. I'm especially interested in whether `virtualenv` is really effective or more of a nightmare to get working... – John C May 24 '11 at 02:01
  • 1
    @Nai, [found it here](http://lucumr.pocoo.org/2008/7/17/deploying-python-web-applications/) - note that I would call it more, some brief comments than a full article or tutorial. – John C May 27 '11 at 02:17
1

I have had success with mod_wsgi

Toni Ruža
  • 7,462
  • 2
  • 28
  • 31
1

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
  • 12,775
  • 4
  • 37
  • 46
0

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

Jim Burger
  • 4,399
  • 1
  • 24
  • 27
0

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
  • 12,097
  • 7
  • 42
  • 71
-2

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
  • 337
  • 5
  • 13