Django with Volume Support
a year ago
Description: Use Railway Volumes with Django
Category: Starters
3 Replies
matt-aPRO
a year ago
nice one, Vin!
noamtamirHOBBY
8 months ago
Thanks this saved me!
The magic lines that helped me:
MEDIA_ROOT = os.environ["RAILWAY_VOLUME_MOUNT_PATH"]
urlpatterns += [ re_path(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT})]