stkr
How to serve media files in Django app on Railway ? Nginx ? Please help
I tried with and without first slashes both
static
and media
, and for each case I tried the mount path /app/uploads
and /app/DepistClic/uploads
. Nothing works, not any media file is accessible through urls of type https://depistclic-production.up.railway.app/uploads/ordonnances/file.pdf
. The files are on the mounted volume, I checked it through ls -la
in entrypoint.sh.
Mystery. Tomorrow I'll try again with nginx I guess, maybe it could serve these files75 replies
How to serve media files in Django app on Railway ? Nginx ? Please help
this is from the access logging:
192.168.0.3 - - [08/Nov/2023:21:12:49 +0000] "GET /uploads/ordonnances/Bilan_annuel_4EjwBX7.pdf HTTP/1.1" 404 179 "https://depistclic-production.up.railway.app/synthese/";
75 replies
How to serve media files in Django app on Railway ? Nginx ? Please help
ok now the missing image link is following:
https://depistclic-production.up.railway.app/uploads/images/Grade_podologique.png
75 replies
How to serve media files in Django app on Railway ? Nginx ? Please help
ok the deploy log is happier:
Operations to perform: Apply all migrations: admin, auth, contenttypes, mainapp, sessions Running migrations: No migrations to apply. 130 static files copied to '/app/DepistClic/staticfiles'. [2023-11-08 20:24:16 +0000] [37] [INFO] Starting gunicorn 21.2.0 [2023-11-08 20:24:16 +0000] [37] [INFO] Listening at: http://0.0.0.0:6789 (37) [2023-11-08 20:24:16 +0000] [37] [INFO] Using worker: sync [2023-11-08 20:24:16 +0000] [39] [INFO] Booting worker with pid: 39
75 replies