In bottle or flask I can do something like this:
for route in app.routes:
description = route.callback.__doc__
method = method
So I can loop through all url (routes) register for given application and see its callback function (view in Django jargon), accepted methods and so on.
I'm wondering if the same is possible with django. So I would like to get all urls for given app and all views that are linked to those urls. Is that can be done?
You need to import
urls
module from project.urls.urlpatterns
is what you are looking for. Try this function: