I have a Django project. Given a url, how can I know which view will be dispatched to handle the request?
+4
A:
You want django.core.urlresolvers.resolve
, which allows you to map an URL to a view and to keep your URL & view logic separate. This is the opposite of django.core.urlresolvers.reverse
which allows you to map a view to a URL.
See the documentation for how to use it!
jathanism
2010-03-05 14:39:52