帮忙看看问题出在哪,我找了大半天~~
url 代码
from django.conf.urls import url
from.import views
urlpatterns = [
url(r'^index/$', views.index),
url(r'^article/(?P<article_id>[0-9]+)$', views.article_page, name='article_page'),
url(r'^edit/$', views.edit_page, name='edit_page'),
url(r'^edit/action$', views.edit_action, name='edit_action')
网页提示错误:
Error during template rendering
In template D:\we\myblog\blog\templates\blog\index.html, error at line 9
u'blog' is not a registered namespace
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<h1>
<a href="{% url 'blog:edit.page' %}">新文章</a>
</h1>
{% for article in articles %}
<a href="">{{ article.title }}</a>
<br/>
{% endfor %}
</body>
</html>
</html>
相关分类