Refresh cache in django

I am using django

in nginx

with FastCGI

and I have a problem with

. According to this question , django caches the file, and I - just like the author of the question above - am unable to change my URL definitions.

My question is, is there a way to clear the url cache in django / nginx / fcgi without restarting the server (which doesn't help in any way)?


source to share

2 answers

It's not just a thing, it's a normal workflow for running a wsgi or fastcgi app. The module is in memory and does not reboot from disk until you tell the server that it has changed.

By the Django FastCGI docs :

If you change the Python code on your site, you need to tell FastCGI that the code has changed. But in this case, there is no need to restart Apache. Rather, just reload mysite.fcgi or edit the file to change the timestamp in the file. When Apache sees that the file has been updated, it will restart your Django application for you.

If you have shell access on a Unix system, you can easily accomplish this with the touch command:

tap mysite.fcgi

For development, in most cases you can use the django development server , which monitors for code changes and reloads when it sees something change.



You don't need to restart the entire server, just the FastCGI application. However, I don't know why you say it doesn't help - this is the way to do it. It can't help but help.



All Articles