About Django Formsets and File Uploads
If you have a form and formsets where the formsets have file uploads, you must set enctype="multipart/form-data"
to the main form for the uploads to work. Here's how to set it with django-crispy-forms
:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
If the main form has file upload fields, django-crispy-forms
is smart enough to add that attribute for you.
Tips and Tricks Programming Development Django 5.x Django 4.2 Django 3.2 HTML5 django-crispy-forms
Also by me
Django Paddle Subscriptions app
For Django-based SaaS projects.
Django GDPR Cookie Consent app
For Django websites that use cookies.