How to inject js to template ?

I have this line of js that allows pop up login and register menu. It works on the first time i tried to load static however after a day or so, it is no longer working. My current method is to store css and js file in static file.

STATIC_URL = "static/"
    BASE_DIR / "static",

Then load the static in base.html:

{% load static %}
  <link rel="stylesheet" href="{% static 'style.css' %}">
  <script src="{% static 'script.js' %}" type="text/javascript"></script>

Anyone know the tips on how to load js on django please help me.

That’s the way to do it from the Django side.

Please provide more details about your environment - is this a development environment or a production deployment? If it’s a production deployment, describe it.

Also please be more specific as to exactly what you’re seeing when you say “it is no longer working”.

Verify what is being rendered in the html for the urls and that your browser is making the requests for those files.

Also, what are your logs showing for the requests for those static files?