Django – restart fcgi

This post is mostly for me… to help remember some things about working with django. Because django is loaded into memory on start-up you need to restart the process when changes are made to the code. I am currently using django with fcgi on a cherokee server.

In the terminal to your server type:

ps -ef | grep python

Look for the process ID which is running django. Then type:

kill -HUP [processid]

Now that you have killed the process you need to restart it. I usually just copy/paste the python command that is listed when I grep the processes. It looks something like this:

python /path/to/django/manage.py runfcgi protocol=scgi host=127.0.0.1 port=35782

You can also set this up to be automated, but I have not done that yet.

https://docs.djangoproject.com/en/dev/howto/deployment/fastcgi/

Comments are closed.