Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

How to fetch all the API urls from django project in Python?

$
0
0

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.pyurlpatterns = [    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...

Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>