How can I modify the html of the fileupload?

18 views
Skip to first unread message

Jorge Cadena

unread,
Sep 7, 2018, 9:45:37 PM9/7/18
to Django users
I want to modify or format the html generators by the input type="file".

I want to give it its own style, with the same structure as the html of the input type="file", of the admin


but:



I'm rendering the form, manually, to add materializecss styles



Jorge Cadena

unread,
Sep 7, 2018, 9:47:49 PM9/7/18
to Django users
I forgot to leave, as I render the input


                        {% elif field.field.widget.input_type in "file" %}
                            <div class="file-field input-field">
                                {{ field.errors }}
                                <div class="btn">
                                    <span>{{ field.label }}</span>
                                    {{ field }}
                                </div>
                                {% if field.help_text %}
                                    <p class="help">{{ field.help_text|safe }}</p>
                                {% endif %}
                            </div>
Reply all
Reply to author
Forward
0 new messages