Py学习  »  问与答

Django 1.8 Tutorial url 问题

t0m1sACat-weibo • 10 年前 • 3368 次点击  

我在学习 Django 1.8.3,跟着 tutorial 到了这里:https://docs.djangoproject.com/en/1.8/intro/tutorial03/#removing-hardcoded-urls-in-templates ,截图如下: tutorial (http://d.pr/i/17FUm)

在模板polls/templates/polls/index.html 里是这样的: 模板代码 (http://d.pr/i/1kMyg)

但是运行的时候却报错: 运行报错 (http://d.pr/i/1j71D)

不知道是什么原因,按照原来教程里 hardcode 的方式可以正确解析 url,模板图里注释掉的那一句,但是换成下面那一句就报错,请问有知道原因的吗?

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/1211
 
3368 次点击  
文章 [ 1 ]  |  最新文章 10 年前
mugbya
Reply   •   1 楼
mugbya    10 年前

< a href="{% url 'detail' question_id = question.id %}" ></a>

ps: 1你用的图床加载图片太慢; 2这种情况还是贴代码的好..