I am attempting to create 2 url prefixes that would be equivalent in my app (this is due to some aesthetic user requirements), and am unsure the best way to go about this. The most straightforward option would be to create another set of urlpatterns with the alternate prefix. However, this would be repetitive and make maintenance more difficult. Is there a simpler way to make foo/<str:key>/ equivalent to bar/<str:key> and staff/<str:key>/ equivalent to foo/<str:key>/staff/?
Current URLS
urlpatterns = [
path('foo/<str:key>/welcome/', views.welcome),
path('foo/<str:key>/dashboard/', views.dashboard),
path('foo/<str:key>/staff/dashboard/', views.staff_dashboard),
]
Desired Patterns
urlpatterns = [
# Original paths
path('foo/<str:key>/welcome/', views.welcome),
path('foo/<str:key>/dashboard/', views.dashboard),
path('foo/<str:key>/staff/dashboard/', views.staff_dashboard),
# Alternate paths to the same pages
path('bar/<str:key>/welcome/', views.welcome),
path('bar/<str:key>/dashboard/', views.dashboard),
path('staff/<str:key>/dashboard/', views.staff_dashboard),
]