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 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 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:
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.
Here's my sample Supervisord conf file for gunicorn:
Hope that helps.