• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

159
Views
Javascript not showing up on template in django

I do not understand why my javascript files are not being applied on my templates. Here is my base.html:

<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Project</title>
    <link rel="stylesheet" type="text/css"  href="{% static 'css/styles.css' %}" />
    <link rel="stylesheet" type="text/css" href="{% static 'css/style.css' %}">
    <link rel="stylesheet" type="text/css" href="{% static 'assets/css/main.css' %}">
    
</head>
<body>
    <div>
        {% include "navbar.html" %}
        {% block content %}  
        {% endblock content %}
    </div>
    {% include "scripts.html" %}
</body>
</html>

Here is my scripts.html:

{% load static %}

<script src="{% static 'js/main.js' %}"></script>
<script src="{% static 'assets/js/jquery.min.js' %}"></script>
<script src="{% static 'assets/js/jquery.dropotron.min.js' %}"></script>
<script src="{% static 'assets/js/browser.min.js' %}"></script>
<script src="{% static 'assets/js/breakpoints.min.js' %}"></script>
<script src="{% static 'assets/js/util.js' %}"></script>
<script src="{% static 'assets/js/main.js' %}"></script>

However, they don't seem to affect the template. For example, the dropdown menu is in a weird format if I run the server. Another weird thing happening is that Main.js keeps being printed on the console. I believe this was initially because of the main.js file which had:

console.log("Main.js");

However, even though I change it to the following:

console.log("Something new for the console");

I still get Main.js printed out on the console. Moreover, if I put console.log("something") for my other javascript files referenced above, they don't get printed out on the console. I have no idea why this is happneing. Thanks, and please ask any questions.

about 3 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Clean up cached images and files!

If you are using Chrome, you can follow the following steps:

  1. go to setting
  2. click on privacy security
  3. click on clear browsing data
  4. check 'Cached images and files'
  5. click on 'Clear data'
about 3 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error