When I import bootstrap css and js to django as static, css file connected and works, but js file show me error: "GET /static/bootstrap/js/bootstrap.min.js HTTP/1.1" 404 179.
My 'main.html'
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
{% load static %}
<!-- Bootstrap -->
<link
rel="stylesheet"
href="{% static 'bootstrap/css/bootstrap.min.css' %}"
/>
<!-- DataTables -->
<!-- Bootstrap JS -->
<script src="{% static 'bootstrap/js/bootstrap.min.js' %}" />
<!-- DataTables JS-->
<!-- DataTable Scripts -->
</head>
<body>
{% include 'navbar.html' %}
<main>
<div class="container">
{% if messages %} {% for message in messages %}
<div class="alert alert-{{message.tags}}">{{message}}</div>
{% endfor %} {% endif %} {% block context %} {% endblock context %}
<footer class="footer">
<div class="container">
<p>© Copyright {% now "Y" %} by <a href=""></a></p>
</div>
</footer>
</div>
</main>
</body>
</html>
My 'setting.py'
STATIC_URL = "static/"
STATICFILES_DIRS = [
BASE_DIR / "static",
]
My project folder structure:
I need import css and js files as static, but django don't see js files, I don't understand what I'm doing wrong.