May-08-2023, 02:39 AM
I am trying to make a hotel reservation app, but my images will not load. I am using Django and Bootstrap
I have my pictures in a media directory in the main directory of my project (with manage.py, myapp, myproject, venv).
I am pointing to these in settings.py
Does anyone have any idea why?
I have my pictures in a media directory in the main directory of my project (with manage.py, myapp, myproject, venv).
I am pointing to these in settings.py
MEDIA_ROOT = os.path.join(BASE_DIR, 'media') MEDIA_URL = '/media/'And here is the div where I want the image to display
<div class='p-4 m-4' style="height: 300px; background-color: rgba(255,0,0,0.1);"> <img src="/media/pic1.jpg" alt="Photo 1"> </div>The image icon is showing in my development browser than an image is coming up, but it is not loading.
Does anyone have any idea why?