2017-08-04 55 views

回答

1

你想要的东西像

from django.core.urlresolvers import resolve 


def your_view(request): 
    # resolve the url from the path 
    url_name = resolve(request.path).url_name 

你可能会想名字添加到您的网址,也name='home'

+0

你是天才!非常感谢 –

+0

@ python_beg2 lol not quite =)我自己在一个点上有同样的问题= D –