MCPcopy Create free account
hub / github.com/encode/django-rest-framework / get_urls

Method get_urls

rest_framework/routers.py:375–390  ·  view source on GitHub ↗

Generate the list of URL patterns, including a default root view for the API, and appending `.json` style format suffixes.

(self)

Source from the content-addressed store, hash-verified

373 return self.APIRootView.as_view(api_root_dict=api_root_dict)
374
375 def get_urls(self):
376 """
377 Generate the list of URL patterns, including a default root view
378 for the API, and appending `.json` style format suffixes.
379 """
380 urls = super().get_urls()
381
382 if self.include_root_view:
383 view = self.get_api_root_view(api_urls=urls)
384 root_url = path('', view, name=self.root_view_name)
385 urls.append(root_url)
386
387 if self.include_format_suffixes:
388 urls = format_suffix_patterns(urls)
389
390 return urls

Callers

nothing calls this directly

Calls 3

get_api_root_viewMethod · 0.95
format_suffix_patternsFunction · 0.90
get_urlsMethod · 0.45

Tested by

no test coverage detected