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

548
Views
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 answers
Answer question

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 Report

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 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!