how to render javascript

Hello everyone. my django project doesnt recorgnize my js file, like its invisible. but its able to see css and images which are all in the same static folder. The thing is if I directly place my js in the html, it works but I want it in the external sheet. I have checked the configuration and everything seem ok. Please help out .

Hello there and welcome!

It would be useful to know how are you running your project, and what are your templates, views and static files involved. Otherwise you’re likely to not get any help.

Thank you for the response. I am not able to post my templates due to some restrictions on the django platform but I have gotten you some portions of my project. I hope it is enough to get me the help I need.

(Attachment New Microsoft Word Document.pdf is missing)

Sorry, i don’t see any documents here.
Can’t you just copy paste the code here?

Welcome @Simmydjango !

As mentioned above, please post the template that is supposed to load this js by copy/pasting the text of the template into your post, surrounded between lines of three backtick - ` characters. This means you’ll have a line of ```, then your template, then another line of ```.
Do not post images or other document types here.

This is my base template:   <!DOCTYPE html>
{% load static %}
<html lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}Home{% endblock %}</title>

    <!-- Bootstrap -->
    <link href="" rel="stylesheet">
    <!-- Django Python stylesheet link -->
    <link rel="stylesheet" href="{% static 'CSS/style.css' %}">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
    <a class="navbar-brand" href="#"> 
        <div class="logo-container">
            {% block brand_Logo %}
            <img src="{% static 'IMAGES/zion.png' %}" alt="Logo" class="logo-image">
            {% endblock %}
        <div class="brand-container">
            {% block brand_label %}
            <h3 class="brand-text">Open School</h3> 
            {% endblock %}
    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
        {% block nav_menus %}
        <ul class="navbar-nav mr-auto">
            <li class="nav-item">
                <a class="nav-link" href="{% url 'home' %}">Home</a>
            <li class="nav-item">
                <a class="nav-link" href="#">Create Account</a>
            <li class="nav-item">
                <a class="nav-link" href="#">Student Application</a>
            <li class="nav-item">
                <a class="nav-link" href="#">Staff Application</a>
        <ul class="navbar-nav ml-auto">
            {% endblock %}
            {% if authenticated %}
            <li class="nav-item">
                <a class="nav-link" href="{% url 'home' %}">Logout</a>
            {% else %}
            <li class="nav-item">
                <a class="nav-link" href="{% url 'login' %}">Login</a>
            {% endif %}
<div class="body_container">   
    {% block content %}    
    {% endblock %}       
<!-- Your content goes here -->
<script src=""></script>
<script src=""></script>
<script src=""></script>

{% block scripts %}
    <script type="text/javascript" src="{% static 'js/index.html' %}"></script>
{% endblock %}

this is the extended login template:  {% extends "base.html" %}
{% load static %}

{% block title %}Login{% endblock %}

{% block content %}
<div class="login-form">
    <form action="/login" method="post">
        {% csrf_token %}
        <label>User Role:</label>
        <div class="form-group">
            <label for="admin">Admin</label>
            <input type="radio" id="admin" name="role" value="admin" required>
            <label for="staff">Staff</label>
            <input type="radio" id="staff" name="role" value="staff" required>
            <label for="student">Student</label>
            <input type="radio" id="student" name="role" value="student" required>
        <div class="form-group" id="admin-form" style="display: none;">
            <label for="admin-sch_code">School Code:</label>
            <input type="text" id="admin-sch_code" name="sch_code" placeholder="Enter your School Code" required>
            <label for="admin-username">Username:</label>
            <input type="text" id="admin-username" name="username" placeholder="Enter your username" required>
            <div class="form-group" id="admin-password-form" style="display: none;">
                <label for="admin-password">Password:</label>
                <input type="password" id="admin-password" name="password" placeholder="Enter your password" required>
                <a href="#">Forgot Password?</a>
        <div class="form-group" id="staff-form" style="display: none;">
            <label for="staff-sch_code">School Code:</label>
            <input type="text" id="staff-sch_code" name="sch_code" placeholder="Enter your School Code" required>
            <label for="staff-username">Username:</label>
            <input type="text" id="staff-username" name="username" placeholder="Enter your username" required>
            <label for="staff-password">Password:</label>
            <input type="password" id="staff-password" name="password" placeholder="Enter your password" required>
            <a href="#">Forgot Password?</a>
        <div class="form-group" id="student-form" style="display: none;">
            <label for="student-id">Student ID:</label>
            <input type="text" id="student-id" name="student_id" placeholder="Enter your student ID" required>
            <a href="#">Forgot Student ID?</a>
        <div class="form-group" id="login-btn" style="display: none;">
            <input type="submit" value="Login" class="login-btn">
{% endblock %}

project  from django.shortcuts import render
from django.contrib import messages

def home(request):
    return render(request, 'home.html')
app  from django.shortcuts import render

# Create your views here.
def login(request):
    return render(request, 'login/login.html')
STATIC_URL = '/static/'

    BASE_DIR / 'static',

import os
from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent

this the structure of my project:    │   └───__pycache__
    │   └───__pycache__
    │   ├───CSS
    │   ├───IMAGES
    │   └───js
````Preformatted text``Preformatted text``Preformatted text``Preformatted text``Preformatted text`

{% static 'js/index.html' %} should be {% static 'js/index.js' %}

Change the file extension.

Thank you your help. I have done the correction but still the problem is not solved.

Maybe, you should see the office document “how to static

Thank you very much for the support. I have been able to resolve it with your help. I noticed the error apart from the wrong reference.