Include enctype in example forms
On this page:
https://docs.djangoproject.com/en/dev/topics/forms/
It took me ages to figure out the reason files weren't uploading was because I'd left out enctype="multipart/form-data" from my <form> tag in my template.
I suggest changing the template examples from:
<form action="/contact/" method="post">{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Submit" />
</form>
to:
<form action="/contact/" method="post" enctype="multipart/form-data">{% csrf_token %}
{{ form.as_p }}
<input type="submit" value="Submit" />
</form>
Change History
(8)
Easy pickings: |
set
|
Triage Stage: |
Unreviewed → Accepted
|
Type: |
Uncategorized → Cleanup/optimization
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
What about using the
is_multipart
property in the documentation?