linux - django静态文件加载错误
PHPz
PHPz 2017-04-17 15:45:46
0
2
623
PHPz
PHPz

学习是最好的投资!

reply all(2)
阿神

1. The official document has this sentence, check if your Debug is True

During development, if you use django.contrib.staticfiles, this will be done automatically by runserver when DEBUG is set to True (see django.contrib.staticfiles.views.serve()).

2. static_root是给python manage.py collectstatic用的,这个目录是给app以外的共同Static目录使用的,不要与app自己目录下的static重名。我觉的你可以把这个配置去掉,或者指向另一个目录,比如project/static
3、如果你指定了static_root,可以运行python manage.py collectstatic,然后看一看,在static_root Check whether the static files under your app are collected correctly. 4. To help locate static files, this command can help you troubleshoot the problem.

python manage.py findstatic /blog/css/style.css --verbosity 2
小葫芦

A small spell error.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template