tangowithdjango ch10
来源:互联网 发布:南京高新盘城网络问政 编辑:程序博客网 时间:2024/04/29 03:48
模版继承
{% extends 'base.html' %}{% block title %}{% endblock %}{% block body_block %}html content{% endblock %}
模版变量
{{ variable_name }}
循环
{% for element in elements %}{{ element }}{% endfor %}
判断
{% if condition %}process{% endif %}
加载静态文件
{% load static %}
url
<a href="{% url 'url_name' arg1 arg2 %}"></a># url_name 为urls.py中的url()方法中的name参数的值
问题
- Reverse for ‘category’ with arguments ‘(u”,)’ and keyword arguments ‘{}’ not found. 1 pattern(s) tried: [‘rango/category/(?P[\w\-]+)/$’]
在渲染index.html的时候出错了,和教程中的代码对了一遍又一遍,确信不是抄错了。最后发现是数据库中有条记录的slug字段值是空的。将那条记录删了,就好了.还有就是如果url()方法中的name的值和html中url的不一致的话也会报类似的错。
0 0
- tangowithdjango ch10
- TangowithDjango--Start
- tangowithdjango ch11
- tangowithdjango ch8 ModelForm
- ch10 流控制
- California Mathmetics-G6-Ch10
- C++ Primer CH9 CH10
- Clean Code CH9 CH10
- ch10.表达式语言
- Accelerated C++ Exercises Ch10
- CH10 面向对象思想
- CH10,日期与时间,
- 读RFC2326RTSP ch10方法定义
- CH10 属性 -.net 复习课
- 【C ++ Primer】ch10 习题解答
- C++PrimerV5/Ch10/ex10.1-
- 《Hadoop The Definitive Guide》ch10 Administering Hadoop
- Art of Multiprocessor Programming 答案 ch10
- intellij IDEA 设置默认的maven配置
- 乘法:n对2
- 乘法
- 乘法-三位数乘两位数
- 进程—异常控制流之故障、终止篇
- tangowithdjango ch10
- dialog强退
- 20160421 VC++6.0环境下gSOAP的使用
- 开源框架OKHttp的使用02-封装后的OkHttpUtils
- 多位数乘一位数
- 作业3
- 浅谈C中的malloc和free
- iOS之退出到后台
- chengfa