Media images not loading in Django Railway project

ekim-67HOBBY

a year ago

Hello all, I am having an issue where images are not loading in my Django application in production (they work on local server). I think this might be something to do with my Media settings.

I have a model, called Profile, that has the field:

image = models.ImageField(default='default.jpg', uploadto='profilepics')

My folder structure is currently:

project-name
->blog
->project-name
->media
--->profile_pics
------>image.jpg
->staticfiles
------>admin
------>blog
->users

My settings.py includes:

STATICROOT = BASEDIR / 'staticfiles'
STATICURL = '/static/' MEDIAROOT = os.path.join(BASEDIR, 'media') MEDIAURL = '/media/'

The static images seems to be loading
But the media images are not

4 Replies

xor0xHOBBY

10 months ago

Good question. Did you solve this problem?


yacinelaribiTRIAL

9 months ago

I have the same problem did u find any solutions ?


tierraskyllcHOBBY

8 months ago

I also have this problem


xor0xHOBBY

8 months ago

U must use S3 or Cloudinary