I am working on a development site built in Django in a virtualenv on an Nginx server using uwsgi.
In
I think you must have to share upper part of your view for more clarification.
But you can try this:
return render(request, template, {'context':context})
Must be either a client-side caching or Nginx caching ;)
(1) in the first case, the browser in not requesting an updated resource because it has been told that the previous resource is still valid;
To confirm this, try using Chrome in incognito and see what happens.
If this is the case, I would add the "never_cache" decorator to the Django views:
from django.views.decorators.cache import never_cache
class MyView(View):
@never_cache
def dispatch(self,request,*args,**kwargs):
return super().dispatch(request,*args,**kwargs)
or, in a function based view:
@never_cache
def myview(request, ...):
...
Using the "never_cache" decorator, you instruct the browser not to cache the page, so whenever the user requires it, he's browser will in turn hit the server.
(2) if not, must be Nginx; check all nginx config files:
and comment out any parameter containing "cache", then restart the service.
I would also turn off "sendfile" as suggested here: https://jeremyfelt.com/2013/01/08/clear-nginx-cache-in-vagrant/
by adjusting file /etc/nginx/nginx.conf
as follows:
...
html {
...
sendfile off;
...