Django templates and pages not updating when viewed in browser

4.6k Views Asked by At

I don't have experience in web development at all, but I know python a bit. I developed a dashboard that shows few stats and graphs with Django templates and pages. I know nothing about using DBs or anything. So what I do is, I run a python script(let's say data_update.py) that updates .html and .js files in the repo to reflect the changes in webview. When an user access the pages, he views the latest pulled data on his browser.

This is all working fine when I host the application on local machine or a server, with "python manager.py runserver"

The problem is this isn't working on PCF. The webviews are showing the stale data from the time I pushed the app to pcf. I tried running data_update.py as task and worker. The .html and .js files are updating fine, except the updated data isn't reflected when accessed in browser.

2

There are 2 best solutions below

3
tstoev On

this is either a caching issue, or wsgi issue, try restarting the application after an update. I do not know how you set up the production but this may help you

1
s4n7h0 On

Try reloading your webserver. For example, if you are using Gunicorn, use the following commands.

sudo systemctl daemon-reload
sudo systemctl restart gunicorn