I'm looking to know the associated class-based view that is associated with a path.
Say I have URL pattern like this :
urlpatterns = [
path("hello/<str:name>/", views.HelloView.as_view(), name="hello-page")
]
Could I, from a path like "hello/foo/" get back to the HelloView class ?
Ideally I'd like to be able to do it like this :
the_url = "hello/foo/"
url_associated_view = get_view_class_from_path(the_url)
print(url_associated_view)
>> HelloView
It's different from this topic because the suggested answer only gives me the as_view function as a value, while I'm trying to get the HelloView class as return value.