user1283776
user1283776

Reputation: 21804

Django admin missing static files when using gunicorn web server

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

Answers (1)

miki725
miki725

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

Related Questions