Currently I have a home server (Ubuntu) with nginx running where I use proxy pass in order to pass the requests to django. I am using gevent as my wsgi server.
It all works fine until the server shuts down either because I restart the server for whatever reason or something crashes (electricity). Since nginx is a service, when the server restarts, nginx starts up as well. However my django apps do not. So then I have to manually go to each of my django projects, activate their virtualenvs, and then fire up the gevent process. This is very annoying to say the least.
Is there a standard way of handling all of this automatically?
You need to set up a script for something like Upstart or Supervisor. Personally, I prefer using Supervisor. Here’s the script I use to run my gunicorn instances: