找不到ERROR 404 js文件

时间:2015-01-13 17:37:30

标签: javascript python html django django-templates

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未找到16毫秒]

项目树 -

bio
-- static
    |-- bio
        |-- js
            |-- template
-- template
    |--bio
        |-- index.html

如何解决此错误。?

1 个答案:

答案 0 :(得分:1)

根据您的项目目录布局,您的路径中似乎缺少bio

{% static "bio/js/fillform.js" %}