index.html 插入URL报错且url配置都是按照老师的来的,求大神帮忙看看

//img.mukewang.com/59e96dde0001aae009710517.jpg

//img3.mukewang.com/59e96ddf00018bf608870305.jpg

帮忙看看问题出在哪,我找了大半天~~

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>    


_飛旋枫叶_0
浏览 1588回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Python