dropzone.js *********** http://www.dropzonejs.com/ dropzone.js + Django: How to build a file upload form: http://amatellanes.wordpress.com/2013/11/05/dropzonejs-django-how-to-build-a-file-upload-form/ WIP === 30/01/2014 ---------- Lovely looking library, but I couldn't get it integrated with Django (not yet anyways). Here are my notes, in case I want to try again in future... In the following code: - The form ID is ``my_form`` (see below), this matches with the ``myForm`` in the ``options`` section - The ``name`` of the file upload field is ``picture``. - The submit button has an ID of ``my_submit``. .. code-block:: javascript {% block stylesheets %} {{ block.super }} {% endblock stylesheets %} {% block script %} {{ block.super }} {% endblock script %} Add the ``fallback`` attribute to the widget: .. code-block:: python class StoryForm(RequiredFieldForm): class Meta: model = Story fields = ('area', 'title', 'description', 'picture') widgets = { 'picture': forms.FileInput(attrs=dict(fallback=True)), } For this section, check out ``dropzone``, ``fallback``, ``my_form`` and ``my_submit``: .. code-block:: html
{% csrf_token %} {{ form.non_field_errors }}
{{ legend }} {% for field in form %}
...