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.".
14 Replies
Project ID:
eece4093-0c94-4750-a28f-df11c0dee106
eece4093-0c94-4750-a28f-df11c0dee106
Solution
please use this template for reference
https://railway.app/template/AWUIv6
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?
I'd look at the settings.py and urls.py files specifically
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'
do you have a volume on your service?
nope. how do i add that?
legend
works now, thanks haha
awsome
thank you for the trains π
all good, thanks for the help π
no problem π