Ubuntu12.04系统下写你的第一个Django1.5应用(三)--view
Ubuntu12.04系统下写你的第一个Django1.5应用(三)--view
写你的第一个视图函数:
第一步,编写视图函数:
<h1>{{ poll.question }}</h1><ul>{% for choice in poll.choice_set.all %} <li>{{ choice.choice_text }}</li>{% endfor %}</ul>移除模板中的URLs硬代码(Removing hardcoded URLs in templates)
参考文献:官方文档 https://docs.djangoproject.com/en/1.5/intro/tutorial03/点击打开链接