Reputation: 21
I'm trying to display a picture whose address is saved in the Django models attribute. As I know you need to enter in the fieldurl({% static movie.img %})
but it doesen't works.
If only use url({% static 'img/default-movie.png' %})
it works.
That is my query sets from django shell:
In [21]: Movie.objects.first().img
Out[21]: <ImageFieldFile: ../MovieApp/movies/static/img/1202296.jpg>
P.S (I should mentioned, that these fields are in for loop {% for movie in movies %}
)
Upvotes: 0
Views: 112