Django Admin CSS missing

后端 未结 11 1106
醉梦人生
醉梦人生 2020-12-24 01:23

I\'ve been messing around with the new collectstatic command and have got it working for my normal pages. That is to say, I am able to load my css at this locat

11条回答
  •  -上瘾入骨i
    2020-12-24 01:58

    I'm using chef to auto-build my django server on an AWS Ubuntu server. This post helped, but what I wound up doing was to add the directory to the package admin static pages in a local_setings.py: https://github.com/jaycrossler/geoq-chef-repo/blob/master/cookbooks/geoq/templates/default/local_settings.py.erb#L16

    (added to local_settings.py or to settings.py):
    
    STATICFILES_DIRS = ('<%= node['geoq']['virtualenv']['location'] %>/local/lib/python2.7/site-packages/django/contrib/admin/static/',)
    

    This resulted in local_settings.py having:

    STATICFILES_DIRS = ('/var/lib/geoq/local/lib/python2.7/site-packages/django/contrib/admin/static/',)
    

    Note, that if you have other items already in your STATICFILES_DIRS, you might want to append to the list, rather than overwriting it.

提交回复
热议问题