By ncc2137
I have a couple buttons that upon clicking adds or deletes data from an array stored on the flask app. This serves as a database of sorts. Everything works fine when testing it locally, but when I host my site live using nignx, it doesn’t seem to save the data right. If I refresh the page it’ll pull a different instance of the data each time. How do I make sure it only refreshes the most recent data?
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!
This sounds like you are storing the data in a dictionary, which is unsorted by default. What you might need to do is update your query code to search through the dictionary for the latest key value that you desire OR to update the code using something like OrderedDict, which is available via the collections module.
If you need more pointers or I am misunderstanding the issue, please provide more details about the code and use case :) Good luck!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.