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

553
Vistas
Using two urls for the same view in django?

So basically, how can I have two urls(or paths) for the same view in django?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Yes, if you have a view some_view you can define two (or more) paths, for example:

urlpatterns = [
    path('foo/', some_view, name='foo'),
    path('bar/', some_view, name='bar'),
]

It is even possible to define these in two separate urls.py. Both will trigger the same view. It is however not very "popular" to have multiple URL patterns for the same view since usually a path explains what it does, for example post/123/delete likely is a view to delete a Post object with 123 as primary key.

over 4 years ago · Santiago Trujillo Denunciar

0

You can have multiple URLs for the same view, I would recommend looking at this answer: How to map two urls to one view?

over 4 years ago · Santiago Trujillo 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