Media deployment in django
I am trying to display media files (images) in railway from the backend of django rest framework. I have configured the settings file and the urls file as it comes in the template:
urlpatterns += [ re_path(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT})]
STATIC_URL = 'static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, "static")]
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
MEDIA_URL = '/media/'
MEDIA_ROOT = os.environ["RAILWAY_VOLUME_MOUNT_PATH"]
This is the path of the media folder: DRF\media\multimedia
I am not able to display the images on the site.
6 Replies
Project ID:
4b66a249-0189-49b9-8839-82fa0f275919
4b66a249-0189-49b9-8839-82fa0f275919
anyone can help me?
this is community help, please be patient, for anyone to help it would greatly benefit if you could share your repo
Thanks Brody! https://github.com/Pacohm00/fibbel
GitHub
GitHub - Pacohm00/fibbel: Software de gestión en Fisioterapia
Software de gestión en Fisioterapia. Contribute to Pacohm00/fibbel development by creating an account on GitHub.
thats a private repo
New reply sent from Help Station thread:
I have problem to. How you solve?You're seeing this because this thread has been automatically linked to the Help Station thread.