Customize ClearableFileInput in django template
问题 I've got a form with profile_picture=ImageField field set to the initial value. It's using ClearableFileInput widget. I need to customize the form in the template, so I can't simply use {{ form.profile_picture}} . How can I split field elements and obtain something which looks like this: {{ with picture=form.profile_picture }} {{ picture.label_tag }} <a href="{{ picture.url }}"> <img src="{{ picture.url }}"> </a> {{ picture.clear-picture }} where {{ picture.clear-picture }} should generate