Here it is, very simple:
<h1> Submit form: </h1>
<form action="/stats/" method="post">
{% csrf_token %}
{{ form.as_p }}
<p><input type="submit" value="Submit" /></p>
</form>
On Monday, August 24, 2015 at 4:31:47 PM UTC-7, Sait Maraşlıoğlu wrote:
-- <h1> Submit form: </h1>
<form action="/stats/" method="post">
{% csrf_token %}
{{ form.as_p }}
<p><input type="submit" value="Submit" /></p>
</form>
On Monday, August 24, 2015 at 4:31:47 PM UTC-7, Sait Maraşlıoğlu wrote:
Can you provide the template code?
On Tuesday, 25 August 2015 00:16:40 UTC+3, Hugo Kitano wrote:Hi, I'm trying to figure out what's wrong with my form:
I've noticed that every time I load my submit view, the request.method is GET not POST, so nothing gets saved to the database.
Here's views.py
models.py
Thanks!!
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+unsubscribe@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.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/92cc7199-3794-43d6-8692-76d0655119e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment