Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

django: admin site not formatted

I have a mostly entirely plain django project, with no adding of my own media or customization of the admin interface in any way. Running the server with python manage.py runserver results in a nicely-formatted admin interface. Running the server with gunicorn_django does not. Why is this the case, and how can I fix it?

It's definitely an issue of not finding the css files, but where are they stored? I never configured this, and the MEDIA_ROOT setting is ''.

EDIT: I just want to know how django-admin serves the non-existent admin files... and how can I get gunicorn_django to do the same?

like image 642
Claudiu Avatar asked Feb 26 '26 04:02

Claudiu


1 Answers

If you use contrib.static, you have to execute a collectstatic command to get all the app-specific static files (including admin's own) into the public directory that is served by gunicorn.

like image 141
rewritten Avatar answered Feb 27 '26 18:02

rewritten