Django Media files is not displaying when debug=false on production in Render [duplicate]

The media files contain stuff that the user uploads.The static folder is right next to the media folder.Now on my deployed machine. If I set the DEBUG = False my static files are presented just fine however my media content is never displayed

`This my settings.py code were debug=false and included the code for the static but my media files is not displaying in the render hosting platform .I want to display my media files on production server when debug=False

`

DEBUG = False

ALLOWED_HOSTS = ["*"]


This my static code but i get static files and it is displaying in the production .But the media files are not displaying in the production server is there any way to solve this problem

STATIC_URL = '/static/'

STATICFILES_DIRS=[os.path.join(BASE_DIR,'static')]

STATIC_ROOT=os.path.join(BASE_DIR,'assets')

STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'

MEDIA_URL='/media/'

MEDIA_ROOT = os.path.join(BASE_DIR, "media")

Im using Render hosting platform for the deployment of the application

Back to Top