If you are using Apache server to host your django site, you need to make sure the static alias point to your /directory to site/site_media/static/. If your static files are in /directory to site/site/site_media/static/, the previous Apache alias configuration will not work.
edited: later I found that in python-2.7.13, writing the following two lines in settings.py (plus clearing the cache of the browser) had done the trick
If you have a value set in settings.py for STATICFILES_DIRS and the declared folder doesn't exist or in wrong location it will cause the Admin to have no styling
例如:
通过定义
STATICFILES _ DIRS = (os.path.join (BASE _ DIR,“ static”))
静态文件夹不存在
Alias /static/ "/opt/bitnami/projects/decisions/decision/"
<Directory "/opt/bitnami/projects/decisions/decision/">
Order allow,deny
Options Indexes
Allow from all
IndexOptions FancyIndexing
</Directory>
我看到有很多答案,但没有一个对我有用,所以我发布了我自己的。
What solved it for me was adding a static files URL to the root URLs of the app. I needed to add this URL to my URLs list: