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/ runfcgi protocol=scgi host= port=35782

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

Comments are closed.