Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've been developing an app using django_socketio (a python port of the Node equivalent), which relies on gevent. It ships with a Django management command that runs gevent's pywsgi server, but that of course stops when I close my terminal window, just like Django's dev server.

This is a proof of concept, and there's no expectation that it would hold up in a production environment, but I'd like to have the server at least "permanently" process HTTP requests, so I don't need to manually start the dev server in order to demo.

I'm assuming I need to run this as a daemon process, but prior to this I've only used apache and mod_wsgi, so unsure of where to begin, or even how I would go about starting a daemon. I found gevent-spawn, which looks promising, but it's unclear to me how that code is executed.

Basically, how would I use gevent to serve a Django app in a setting without manually starting/stopping the server?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Check out gunicorn which provides process management for gevent WSGI servers.

You'd need to run it as gunicorn -k gevent_pywsgi to choose the right worker.

It has daemonize mode. I use it in conjunction with runit which is a more flexible alternative to daemon mode.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.