I’m using nginx+fastcgi via unix socket to my django site. I’m using the following command to start the django site:
python manage.py runfcgi socket=/var/run/fcgi.django.sock method=prefork daemonize=true
How do I make this autostart in the event of reboot or is there some better way of starting the django server?
Also, is what I’m doing best practice? I don’t have much experience with python servers so my biggest concern is reliability / performance. Any guidance would be much appreciated!
To autostart such a process you need to use a process manager like supervisor. Supervisor will then automatically start your process on system reboot and provide you a central place to manage your custom processes.
Most people prefer the django + nginx + uwsgi or django + nginx + gunicorn stacks.