Django找不到static静态资源文件

为python中试图配置css,报错找不到css文件

[06/Jun/2018 09:19:13] "GET /polls/ HTTP/1.1" 200 241
[06/Jun/2018 09:19:13] "GET /static/polls/style.css HTTP/1.1" 404 1669
[06/Jun/2018 09:24:22] "GET /polls/ HTTP/1.1" 200 199
[06/Jun/2018 09:24:22] "GET /static/polls/style.css HTTP/1.1" 404 1669
[06/Jun/2018 09:24:23] "GET /polls/ HTTP/1.1" 200 199
[06/Jun/2018 09:24:23] "GET /static/polls/style.css HTTP/1.1" 404 1669
[06/Jun/2018 09:24:23] "GET /polls/ HTTP/1.1" 200 199
[06/Jun/2018 09:24:23] "GET /static/polls/style.css HTTP/1.1" 404 1669
{% load static %}

{% if latest_question_list %}
    
{% else %}
    

No polls are available.

{% endif %}

在settings.py中进行如下修改

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')

你可能感兴趣的:(Django找不到static静态资源文件)