Your image will be uploaded to the media folder, so it’s better to change the path in the model, for example images/ , and they will be uploaded to media/images
In settings.py add this
MEDIA_URL = '/media/' MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
In url.py
from django.conf.urls.static import static from django.conf import settings urlpatterns = [.... ]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
And then, if you want to display all this image, use something like this in view.py
BlogContent.objects.all()
And do it like this:
{% for img in your_object %} <img src="{{ img.image.url }}" > {% endfor %}
source share