R
Railwayβ€’14mo ago
lionel

Railway server cannot find images uploaded to postgresql database

I have a django website and is connected to a postgresql database on railway. When I upload photos to the database through the /admin page, and then I try to look at the pictures from admin page, i receive the error "Not Found: The requested resource was not found on this server.".
Solution:
please use this template for reference https://railway.app/template/AWUIv6...
Jump to solution
14 Replies
Percy
Percyβ€’14mo ago
Project ID: eece4093-0c94-4750-a28f-df11c0dee106
lionel
lionelOPβ€’14mo ago
eece4093-0c94-4750-a28f-df11c0dee106
Solution
Brody
Brodyβ€’14mo ago
please use this template for reference https://railway.app/template/AWUIv6
lionel
lionelOPβ€’14mo ago
do i just copy over parts of my project? or are there specific files and such that i need to reference and use in my current one?
Brody
Brodyβ€’14mo ago
I'd look at the settings.py and urls.py files specifically
lionel
lionelOPβ€’14mo ago
thanks. I've deployed but I'm getting an error: File "/app/mums_portfolio/settings.py", line 164, in <module> MEDIA_ROOT = os.environ["RAILWAY_VOLUME_MOUNT_PATH"] ~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen os>", line 679, in getitem KeyError: 'RAILWAY_VOLUME_MOUNT_PATH'
Brody
Brodyβ€’14mo ago
do you have a volume on your service?
lionel
lionelOPβ€’14mo ago
nope. how do i add that?
lionel
lionelOPβ€’14mo ago
legend works now, thanks haha
Brody
Brodyβ€’14mo ago
awsome
Brody
Brodyβ€’14mo ago
thank you for the trains πŸ™‚
lionel
lionelOPβ€’14mo ago
all good, thanks for the help πŸ™‚
Brody
Brodyβ€’14mo ago
no problem πŸ™‚
Want results from more Discord servers?
Add your server