There are several ways to deal with this problem. So now you are restarting the development server as if it were Apache. Worse, it seems to be caching the files itself at times, as even telling your browser to reload the page often fails to refresh its cache. Django’s development server doesn’t seem to know that the files have changed. When you change your stylesheets or other static resources, you will find that your browser seems to stubbornly hold on to the stale, cached versions. This is usually more convenient for several reasons the main one may be that the development server loads new code as you change it and need not be restarted. Apache or Nginx can serve these files fast, and can handle caching issues, telling the client when it already has the current version and need not download a new one.īut when you are developing a Django application, you typically serve it using Django’s development server to a browser on your local machine, rather than bothering with a real webserver such as Apache. Static files are stylesheets, images, anything sitting on your server that is returned in response to a request and does not need to be constructed dynamically. At least, that’s what should be happening. When your Django application is deployed to the public web, its static files are served directly by Apache or Nginx without any involvement by Django or your Python code.
0 Comments
Leave a Reply. |