Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

270
Views
No se puede cargar el archivo estático JS, pero el archivo style.css aún funciona

Este es mi error. El archivo styles.css e index.js en la misma red de nombre de carpeta. Pero el archivo styles.css funciona, y el archivo index.js no funciona, mirando a mi otro proyecto es Mail

 [20/Feb/2022 14:17:59] "GET / HTTP/1.1" 200 1804 [20/Feb/2022 14:17:59] "GET /static/network/styles.css HTTP/1.1" 304 0 [20/Feb/2022 14:18:01] "GET /static/mail/inbox.js HTTP/1.1" 404 1667 [20/Feb/2022 14:18:01] "GET / HTTP/1.1" 200 1804

configuración.py

 STATIC_URL = '/static/'

índice.html

 {% extends "network/layout.html" %} {% load static %} {% block body %} {% endblock %} {% block script %} <script src="{% static 'network/index.js' %}" defer></script> {% endblock %}

índice.js

 console.log('OK');

diseño.html

 {% load static %} <!DOCTYPE html> <html lang="en"> <head> <title>{% block title %}Social Network{% endblock %}</title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> <link href="{% static 'network/styles.css' %}" rel="stylesheet"> </head> <body> <div class="body"> {% block body %} {% endblock %} </div> </body> </html>
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Debe agregar block script en layout.html

 {% load static %} <!DOCTYPE html> <html lang="en"> <head> <title>{% block title %}Social Network{% endblock %}</title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> <link href="{% static 'network/styles.css' %}" rel="stylesheet"> </head> <body> <div class="body"> {% block body %} {% endblock %} </div> {% block script %} {% endblock %} </body> </html>
about 4 years ago · Juan Pablo Isaza Report

0

agregue el tipo al script y pruébelo:

 <script type="text/javascript" src="{% static "network/index.js" %}"></script>
about 4 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 Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!