导入模块 from django.core.urlresolvers import reverse reverse() reverse(viewname, urlconf=None, args=None, kwargs=None, current_app=None) # django视图 from news import views url(r'^archive/$', views.archive, name='news-archive') 生成url # using the named URL