Refresh urls.py cache in django
I am using django
in nginx
with FastCGI
and I have a problem with urls.py
. According to this question , django caches the url.py 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
It's not just a urls.py 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.
source to share