找不到错误 404 js 文件
ERROR 404 js file not found
Html
{% load staticfiles %}
<html>
<head>
<script src="{% static "js/fillform.js" %}" type="text/javascript">
</script>
</head>
<body>
yo man ssup
<button type="button" id="button">
click
</button>
</body>
</html>
settings.py
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
加载时出现错误
[HTTP/1.0 404 Not Found 16ms]
和项目树-
bio
-- static
|-- bio
|-- js
|-- template
-- template
|--bio
|-- index.html
如何解决这个错误?
根据您的项目目录布局,您的路径中似乎缺少 bio
:
{% static "bio/js/fillform.js" %}
Html
{% load staticfiles %}
<html>
<head>
<script src="{% static "js/fillform.js" %}" type="text/javascript">
</script>
</head>
<body>
yo man ssup
<button type="button" id="button">
click
</button>
</body>
</html>
settings.py
STATIC_URL = '/static/'
STATICFILES_DIRS = (
os.path.join(BASE_DIR, 'static'),
)
加载时出现错误
[HTTP/1.0 404 Not Found 16ms]
和项目树-
bio
-- static
|-- bio
|-- js
|-- template
-- template
|--bio
|-- index.html
如何解决这个错误?
根据您的项目目录布局,您的路径中似乎缺少 bio
:
{% static "bio/js/fillform.js" %}