0

My html form's image part:

{% for photo in date.photo_set.all %}
<div class="photo-wrapper-{{ forloop.counter }}">
     <input type="file" name="current-photo-{{ forloop.counter }}"
          value="{{ photo }}" accept="image/*">
</div>
{% endfor %}

Okay so this is a part of my form in Django. In form I show all current photos of model. When I submit the form I want to get that current photos in self.request.POST.keys(). But their key's values are empty like so: 'current-photo-1': [''], 'current-photo-2': [''] (if there 2 current images). As I understand the issue is in value attribute of <input> tag in my html form. It doesn't store any object-like stuff (image). How to make it actually store current photo? Maybe by converting to base64? Hope you got it. If any questions, don't hesitate. Thanks!

Note. I am pretty sure this information is enough for you to answer this question.

0 Answers0