Reputation: 21804
When I run my project with runserver
, django admin is showing with static files. Everything looks pretty.
But when I run my project with the gunicorn
web server, static files for the django admin are not found:
Not Found: /
Not Found: /favicon.ico
Not Found: /static/admin/css/base.css
Not Found: /static/admin/css/login.css
Not Found: /static/admin/css/base.css
Not Found: /static/admin/css/dashboard.css
Why are these static files not served out of the box?
What steps should I make to serve the static files for django admin via gunicorn
?
I'm using Django 1.9 with python 3.4
Upvotes: 9
Views: 4669
Reputation: 27861
You need to collect all static files via manage.py collectstatic
command. More information in the docs - https://docs.djangoproject.com/en/1.9/ref/contrib/staticfiles/#django-admin-collectstatic
Upvotes: 9