I have a django project, where some API URLs are present in urls.py in urlpatterns path and some are registered as routers(rest_framework_extensions.routers).
ref:
# urls.py
urlpatterns = [
path("healthcheck/", health_check_view, name="healthcheck"),
path("something/", include(router_something.urls))
]
here, router_something is being used to register further urls like:
router_something = DefaultRouter(trailing_slash=False)
router_something.register(r"path1/(?P<pk>d+)/roles", SomeViewSet)
I want to fetch all the urls in the django project with their complete path, for example:
healthcheck/
something/path1/1/roles # here i am replacing the placeholder pk with 1, this is something I can do
...
New contributor
Abinash Biswal is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.