Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

115
Vistas
Javascript code is not displaying in django

here Javascript code is not displaying in Django. even before I did lot of research on it but unable to find. I really don't know what to do here. please anyone guide me how to do this. This help will be precious for me.

static/js/script.js:

var bar = new ProgressBar.Circle(container, {
    color: '#ff0000',
    // This has to be the same size as the maximum width to
    // prevent clipping
    strokeWidth: 4,
    trailWidth: 1,
    easing: 'easeInOut',
    duration: 10000,
    text: {
      autoStyleContainer: false
    },
    from: { color: '#ff0000', width: 5 },
    to: { color: '#00cc00', width: 9 },
    // Set default step function for all animate calls
    step: function(state, circle) {
      circle.path.setAttribute('stroke', state.color);
      circle.path.setAttribute('stroke-width', state.width);
  
      var value = Math.round(circle.value() * 100);
      if (value === 0) {
        circle.setText('');
      } else {
        circle.setText(value);
      }
  
    }
  });
  bar.text.style.fontFamily = '"Raleway", Helvetica, sans-serif';
  bar.text.style.fontSize = '2rem';
  
  bar.animate(1.0);  // Number from 0.0 to 1.0

html file:

<div id="container"></div>

settings.py:

STATIC_URL = '/static/'
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static')]

I'm getting correct output in command prompt but it is not displaying on template.

output in cmd:

"GET /static/js/script.js HTTP/1.1" 304 0
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Then add script in your html as:

<script type="text/javascript" src="{% static 'js/script.js' %}"></script>
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda