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
How to execute fetch paths without interfering with webpage pathname?

I am working on a Django project and got stuck on url patterns and routes.

On index.html, the pathname is "" and the JS functions are working great. The fetch url tweets/${tweetid} is matching with Django API route url pattern tweets/<int:tweetid> and is working fine.

However, on profile.html, the pathname is "profile/<int:userid>" and JS is not working here. The fetch url tweets/${tweetid} results the final path profile/tweets/<int:tweetid>. Since that is not in urls.py, I am getting an error.

How can I execute my fetch and JS functions on any html page in this web application?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You should start the path with a leading slash (/) to use an absolute path, not a relative path, so:

/tweets/${tweetid}

The leading slash means that it will for example fetch the page hostname.ext/tweets/1234. If you use a relative path (without a leading slash), the item will be appended to the already specified path.

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