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
10 months ago
Good question. Did you solve this problem?
9 months ago
I have the same problem did u find any solutions ?
8 months ago
I also have this problem
8 months ago
U must use S3 or Cloudinary