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://18.104.22.168:8000 …everything works perfectly
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $200 of credit to try our products over 60 days!