Reputation: 13
I have static files in a specific app in my project, and I add that route in my config file as my static route for EB, and as I do this EB doesn't load required CSS files for django admin page.
My python.config looks like:
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: MyProject/wsgi.py
"aws:elasticbeanstalk:container:python:staticfiles":
/static/: "MyApp/static/"
And I get the following error:
Failed to load resource: the server responded with a status of 404 (Not Found) /static/admin/css/responsive.css:1
Upvotes: 1
Views: 1251
Reputation: 406
To tell Django where to store static files, define STATIC_ROOT in settings.py:
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/2.1/howto/static-files/
STATIC_URL = '/static/'
STATIC_ROOT = 'static'
And type the commande:
python manage.py collectstatic
Upvotes: 1