News for hackers. Stuff that matters.
Re:Setting up Django with gunicorn, nginx, supervisord and f... by geekfactor on Monday June 27, 2011 @12:36PM (#2701910)
For my first Django project I spent a few weeks porting an old php site over to Django and then another couple of weeks trying to get it deployed to my Linode server.

I really liked Django but the deployment process was very frustrating. I started with Apache/mod_wsgi which ate up a bunch of time but I eventually punted and went to gunicorn and nginx which worked pretty well. I also ran down a bit of a blind alley with buildout but eventually saw the light and started using virtualenv + pip. I used fabric to automate deployment and Ubuntu's upstart for process management.

In the end I got the process working pretty well, save a few issues, but it left a bad taste in my mouth. There was a period of time where I was waiting to get into the Djangy beta, and I was very optimistic that that would fill the gap for me, but that company eventually went away, helping to motivate me to look into Rails so that I could deploy on Heroku. (Note: There seem to be a couple of viable Django-PaaS options today, including Gondor.io and DotCloud.)

I'm finishing up my first Rails 3 project now and I love it, especially the Heroku-based deployment model.

P.S. The other motivator for me to jump to Rails was first-class support for HAML and SASS. I tried all the Python/Django hacks and got them working, but it was clunky as hell. There have been notable complaints of late about how fast Rails is changing, but I think the amount of innovation that has been going on in and around the framework is amazing.

Re:Setting up Django with gunicorn, nginx, supervisord and f... by geekfactor on Monday June 27, 2011 @05:35PM (#2703115)
Why was this downvoted?
Re:Setting up Django with gunicorn, nginx, supervisord and f... by bhoung on Tuesday June 28, 2011 @12:16AM (#2704053)
most people drawn to this article are python django programmers?
Re:Setting up Django with gunicorn, nginx, supervisord and f... by ehutch79 on Monday June 27, 2011 @08:26AM (#2701045)
I know it's like a LTS type thing, but a new article advocating installing python 2.6 over 2.7 seems pointless to me at this point. Why would you not install the latest 2.7?
Re:Setting up Django with gunicorn, nginx, supervisord and f... by bryanh on Monday June 27, 2011 @10:28AM (#2701396)
While he built from source, its worth nothing that Python 2.6 seems to be the newest version in the yum repos (last time I checked).
Re:Setting up Django with gunicorn, nginx, supervisord and f... by dennyabraham on Monday June 27, 2011 @09:50AM (#2701261)
I'm unfamiliar with python and supervisord, but is supervisord able to manage the status of gunicorn and its child processes without explicitly being given the gunicorn pid? I've been investigating doing the same in Rails (I'll likely use bluepill) and I'd like to understand how this is done in the python ecosystem.
Re:Setting up Django with gunicorn, nginx, supervisord and f... by conesus on Monday June 27, 2011 @10:03AM (#2701307)
Supervisor is responsible for starting the gunicorn process, so it knows the PID when it starts it. Gunicorn controls its own PID file, but supervisor can send it process signals.

Here's my sample Supervisord conf file for gunicorn:

    [program:gunicorn]
    directory=/home/sclay/newsblur
    command=gunicorn_django -c config/gunicorn_conf.py
    user=sclay
    autostart=true
    autorestart=true
    #redirect_stderr=True
    priority=991
    stopsignal=HUP
Hope that helps.
Re:Setting up Django with gunicorn, nginx, supervisord and f... by dennyabraham on Monday July 04, 2011 @10:09AM (#2726570)
thanks!
Re:Setting up Django with gunicorn, nginx, supervisord and f... by chaselee on Monday June 27, 2011 @08:41AM (#2701087)
Great post Ken! For anyone who didn't check it out from this article, here's another awesome post by Ken I spent a lot of time with recently: http://kencochrane.net/blog/2011/06/django-hosting-roundup-w...
Re:Setting up Django with gunicorn, nginx, supervisord and f... by arthurk on Monday June 27, 2011 @09:12AM (#2701160)
Why Python 2.6 and not 2.7?
Re:Setting up Django with gunicorn, nginx, supervisord and f... by KenCochrane on Monday June 27, 2011 @10:07AM (#2701321)
This blog post was based on a project that I did that required python 2.6.6, you could use python 2.7 if all of your dependencies support it.