NoReverseMatch at /myblog/index/
Reverse for 'article_page' with arguments '('',)' not found. 1 pattern(s) tried: [u'myblog/article/(?P<article_id>[0-9]+)$']
myblog/url.py:
urlpatterns = [
url(r'^index/$', views.index),
url(r'^article/(?P<article_id>[0-9]+)$', views.article_page,name='article_page'),
]
index.html:
<body>
<h1>
<a href = "">新文章</a>
</h1>
{% for article in articles %}
<a href = "{% url 'myblog:article_page' article.id %}">{{article.title}}</a>
<br/>
{% endfor %}
</body>
Django版本:1.11.14
python版本:2.7
输入:{% for article in articles %}时,“for”和“in”没有改变颜色,是不是我的django版本有问题,不支持for循环?