简体   繁体   中英

Missing css in Django admin

I'm used nginx + unicorn + Django and absence css only in Django admin. I'm not understand the reason. Static is shown on all a pages besides admin. In terminal is see 200code: http://joxi.ru/KAxLRZEi4kdQYA In console missing error: http://joxi.ru/12M6KL0i4jpO9A PS I make collectstatic.

settings

INSTALLED_APPS = [
'homepage',
'info',
'login',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]

STATIC_URL = '/static/'
MEDIA_URL = '/media/'
ADMIN_MEDIA_PREFIX = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static/')
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')

You have incorrect mime type resolve nginx settings. It sends css, but set default Content-Type: text/plain . Add include mime.types; (or set path to another mime.types file) for nginx.conf or set it manualy

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM