Django-staticfiles breaking admin interface

I use the django-staticfiles application to work with css files, but it also prevents the necessary css admin files (media / base.css, media / dashboard.css) from loading. It looks like I need to exclude the admin application, but adding it to STATICFILES_EXCLUDED_APPS did not help.

Here are the relevant bits from my settings.py file:

 ADMIN_MEDIA_PREFIX = '/media/' ... STATIC_URL = '/static/' STATIC_ROOT = '' STATICFILES_EXCLUDED_APPS = ( 'django.contrib.admin', ) INSTALLED_APPS = ( ... 'django.contrib.admin', 'staticfiles', ) 
+4
source share
1 answer

(I assume this is for development, since you should not statically use static content with django-staticfiles.)

You must define the ADMIN_MEDIA_ROOT variable in the settings.py file and point it to the location of the css admin files. I moved these files from site packages to be in the same place as other static files for easy deployment.

+4
source

Source: https://habr.com/ru/post/1341369/


All Articles