I had my Django app running successfully in a droplet. I was accessing site through IP provided by DO. I had to deploy the same project for another client. So I powered off the droplet, created snapshot and created another droplet from snapshot image. Everything looked quite fine but I started to find a weird issue. I have a form, when i submit a form, it gets submitted successfully. I can also confirm in in django admin. Submitted form values are all good. But i render those form value in pdf (I am using Xhtml2pdf). Now when i access that pdf, it gives me previous values. It seems like it’s caching something (but i haven’t cached anything). Initially i thought this problem is only in this new droplet but i found that same thing is happening in other droplet which was running fine until now.
Things I tried
Restarted gunicorn, nginx
I thought because both app have the same secret key(django settings), could be that problem so i even changed the secret key
I have checked and restarted everything in this tutorial https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-20-04 . All seems good
I don’t get any error, just my pdf page don’t show the values.
I thought it was my laptop browser issue so i tried in different devices. Result is same
and finally if this might help to get me the answer. If i run the app in dev server http://126.96.36.199:8000 …everything works perfectly
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.