I have a Django form which has an ImageField
in it, and I render the field like this in my template:
{{ form.my_image_field }}
The resulting HTML looks like this:
Currently: <a href="https://....s3.amazonaws.com/....jpg">....jpg</a>
<input name="my_image_field-clear" id="my_image_field-clear_id" type="checkbox">
<label for="my_image_field-clear_id">Clear</label><br>
Change:
<input name="my_image_field" id="id_my_image_field" type="file">
I want to render only the <input
element, since I am using the bootstra-fileinput library: https://www.npmjs.com/package/bootstrap-fileinput :
<input name="my_image_field" id="id_my_image_field" type="file">
Is it possible to do this without writing the <input>
tag manually in the template?