samedi 20 novembre 2021

How to solve the error when dummy data gets stored in Django database with its id as none and all values as null

I had made this form in Django which takes some data and when a save button is clicked it saves it to the database. It stores the data that I give, but I noticed that every time I refreshed the page that contained the form it would automatically save an object with the Id as none and all values set to null. I wanted to know how to write a function that says the form only submits to the database when the save submit button is clicked and not when reloading the page and making a dummy object in the database.




Aucun commentaire:

Enregistrer un commentaire