Reputation: 79
Not sure how to display my ImageField in Django. Currently, my images are located in /media/static/ and the paths on my terminal all match up to where the images are locally. How come the images do not display?
^^ using above code in index.html to display the image.
^^ settings.py
^^ urls.py within the current application
^^ models.py
^^ views.py
Upvotes: 0
Views: 694
Reputation: 47374
You also need to add MEDIA_URL
to your urlpatterns(see docs):
urlpatterns = [
# ... the rest of your URLconf goes here ...
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Upvotes: 1