reverse(viewname, urlconf=None, args=None, kwargs=None, current_app=None) [source]
viewname can be a URL pattern name or the callable view object. For example, given the following url:
from news import views
url(r'^archive/$', views.archive, name='news-archive')
you can use any of the following to reverse the URL:
# using the named URL
reverse('news-archive')
# passing a callable object
# (This is discouraged because you can't reverse namespaced views this way.)
from news import views
rev