from django.shortcuts import redirect from django.urls import path from . import views urlpatterns = [ path("", views.index, name="index"), # ex: /CMS00001/ path("/", views.toolDetail, name="toolDetail"), # ex: /CMS00001/tasks/ path( "/tasks/", lambda request, tool_slug: redirect("toolDetail", tool_slug), ), # ex: /CMS00001/tasks/task_name/ path("/tasks/", views.taskDetail, name="taskDetail"), ]