【发布时间】:2015-10-01 14:42:43
【问题描述】:
是否可以为一个 URL 模式定义多个 names?我想合并两个视图而不找到每个视图的所有引用并更改它们。保留这两个名称的另一个好处是,以防我以后想再次拆分它们。
例如合并
url(r'^login/', TemplateView.as_view(template_name='login.html'), name='login'),
url(r'^profile/', TemplateView.as_view(template_name='profile.html'), name='profile'),
到
url(r'^profile/', TemplateView.as_view(template_name='profile.html'), name=('login', 'profile')), #???
【问题讨论】:
标签: django django-urls