Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Django images will not load
#3
You need to import the media folder. Put these lines of code in your urls.py

from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
   #urls
   #...
 ]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) 
https://docs.djangoproject.com/en/4.2/ho...tic-files/

Hope this helps..
Reply


Messages In This Thread
Django images will not load - by pythonpaul32 - May-08-2023, 02:39 AM
RE: Django images will not load - by SpongeB0B - Jul-11-2023, 04:57 PM
RE: Django images will not load - by mactron - Jul-15-2023, 01:10 PM
RE: Django images will not load - by Gaurav_Kumar - Jul-20-2023, 10:30 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Fetching Images from DB in Django Dexty 2 1,949 Mar-15-2024, 08:43 AM
Last Post: firn100
  display local images on django website mp3909 2 6,510 Apr-01-2020, 11:18 AM
Last Post: mp3909
  Django: How to automatically substitute a variable in the admin page at Django 1.11? m0ntecr1st0 3 3,527 Jun-30-2019, 12:21 AM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020