繁体   English   中英

找不到错误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找不到16ms]

和项目树-

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

如何解决这个错误。

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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM