If there's a file in the form data, I'm no expert but I have fought a 
little with forms and files and I advise you to look in the internet for 
multipart forms and file inputs inside forms.

On Tuesday, 25 August 2015 21:12:46 UTC+2, Hugo Kitano wrote:
>
> I've realized that the action field in the form should be 
> "/stats/submit/", the same view as the one that sent me to the template.  
> However, whenever I submit with the form then, it tells me that the file I 
> submit is missing, even when it is definitely there.
>
> On Tuesday, August 25, 2015 at 10:10:30 AM UTC-7, Hugo Kitano wrote:
>>
>> 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:
>>>
>>> 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+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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dfa54e00-a8d4-4e02-9955-7c692e209f4c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to