On 08/09/2013 04:40, Harjot Mann wrote:
On Wed, Sep 4, 2013 at 10:42 AM, Laurent Meunier <laur...@deltalima.net> wrote:
Can you show use the source code of the view where you create your entry in
the database?


Sure. Here is the link to code:
http://tny.cz/09090f4c


Thanks for the link.

Harjot is right, you are not doing a redirect after you create your object. Since the browser is not redirected, if you refresh the page the browser send an other POST (and a new object is created). If you redirect after a POST, the browser is now in a GET page, and when you refresh the browser send a GET instead of a POST.

Take a look at a standard pattern for processing a form in a view:
https://docs.djangoproject.com/en/dev/topics/forms/#using-a-form-in-a-view


--
Laurent Meunier <laur...@deltalima.net>

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to