Django URL resolving ¶
How to debug Django’s url resolving ? ¶
If you are new to a big project, you might not easily see which view function does handle an URL.
You can use resolve() to get the answer:
import django
django.setup()
from django.urls import resolve
print(resolve('/foo/bar/'))
--> ResolverMatch(func=foocms.views.bar_handler, args=('/foo/bar/',), kwargs={}, url_name=foocms, ...)