1
一起使用django的命名路由有問題。當叫如下Django的不斷提高NoReverseMatch錯誤:Django命名的路線不能與django.views.generic.simple.redirect_to
urlpatterns += patterns('django.views.generic.simple',
# tutorials
url(r'^tutorials/?$', 'redirect_to', {'url':'/tutorials/markers/'}, name='tutorials'),
(r'^tutorials/markers/?$', 'direct_to_template', {'template': 'page_tutorials_markers.html'}),
)
# in template:
<a href="{% url tutorials %}">tutorials</a>
它看起來不言自明,但我想不通,爲什麼這條線路不被認爲具有具名的路線。
感謝,
Ĵ
感謝您的帖子。這可能是很好的一般性建議,但這並不會改變這個問題。我已經拿出了兩個條目上的問號,問題依然存在。 – 2011-12-15 23:54:13