In model my image field is showing blank even though I have inserted the image from html
Asked
Active
Viewed 63 times
0
-
please provide models.py views.py admin.py and settings.py – Manoj Tolagekar Oct 04 '22 at 09:25
1 Answers
1
Show your code. Once the views.py
, the models.py
and your html
. Here are my two best guesses:
1 verify you have the enctype
declared in the html tag
<form action="" method="post" enctype="multipart/form-data">
{% csrf_token %}
{{form.as_p}}
<button type="submit">Save</button>
</form>
2 verify you request includes request.FILES
form = YourForm(request.POST, request.FILES, instance=instance)

hanspeters205
- 381
- 2
- 6