简体   繁体   中英

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'),
)

and upon loading it gives error

[HTTP/1.0 404 Not Found 16ms]

And project tree -

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

How to solve this error.?

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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