Django Admin CSS missing

后端 未结 11 1108
醉梦人生
醉梦人生 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条回答
  •  既然无缘
    2020-12-24 01:48

    In Django 1.4 ADMIN_MEDIA_PREFIX is deprecated. Here are the steps I followed to catch up with these somewhat recent Django changes:

    1. in settings.py, add django.contrib.staticfiles to INSTALLED_APPS

    2. in settings.py define STATIC_URL — the staticfiles app won't run without it. While using runserver they'll get handled magically, but when you deploy, this needs to be a location where those resources can be fetched by a browser.

    I think that's all there was to it.

提交回复
热议问题