The default CSS of Django admin section is not loading -
folks, default css of django admin section not loading (setup uses nginx reverse proxy + gunicorn, os debian-based ubuntu).
the following part of etc/nginx/sites-available/myproject
:
location /static/admin { alias /home/mhb11/.virtualenvs/myenv/local/lib/python2.7/site-packages/django/contrib/admin/static/; }
that, btw, points correct location of django admin's css files, , written below location /static/ {}
snippet (not shown here).
note have tried root
directive instead of alias
too, no avail. note error pertains solely django admin static files. project related static files working perfectly. note settings.py file includes 'django.contrib.staticfiles',
in installed_apps , static_url = '/static/'
.
what missing? please ask more information in case needed.
it may not significant, consistency, location
path , alias
path should both end /
or neither end /
.
with current configuration, server constructing path names embedded //
, /home/mhb11/.virtualenvs/myenv/local/lib/python2.7/site-packages/django/contrib/admin/static//somefile.css
.
try:
location /static/admin/ { alias /home/mhb11/.virtualenvs/myenv/local/lib/python2.7/site-packages/django/contrib/admin/static/; }
Comments
Post a Comment