我正在尝试使用 ye olde templatetagTemplateView.as_view()
来urls.py
命名它url
。这应该工作吗?还是我只是做错了..?还是我的应用程序中的一些遗留废话干扰?我有...
<li><a href="{% url "legal" %}">Terms and Conditions</a></li>
和
url(r'^legal/$', TemplateView.as_view(template_name="legal.html"), name="legal"),
哪个产量
NoReverseMatch at /how-it-works/
Reverse for '"legal"' with arguments '()' and keyword arguments '{}' not found.
在我看来,这永远不会以这种方式工作。
我们如何用 反转网址TemplateView
?