I am deploying my Django application to Railway.
I am following this guide, https://docs.djangoproject.com/en/4.2/howto/static-files/deployment/#how-to-deploy-static-files. The app was deployed successfully but cannot load the static files. I followed some online tutorials on this and it is still not working. What did I miss?
My Railway deploy log:
Not Found: /static/styles/style.css
Not Found: /static/images/logo.svg
Not Found: /static/styles/style.css
Not Found: /static/images/logo.svg
Not Found: /static/images/avatar.svg
Not Found: /static/images/avatar.svg
Not Found: /static/js/script.js
Not Found: /static/js/script.js
settings.py:
DEBUG = False
STATIC_ROOT = BASE_DIR / "staticfiles"
STATIC_URL = '/static/'
STATICFILES_DIRS = [
BASE_DIR / "static",
]
MEDIA_URL = '/images/'
MEDIA_ROOT = BASE_DIR / 'static/images'