Django:ExtendsNode: extends 'base/base.html'> must be the first tag in the template.
来源:互联网 发布:淘宝开店铺卖什么好呢 编辑:程序博客网 时间:2024/06/10 05:41
学习Django的过程,敲教程的样例过程,到模板继承这里,总是报下面的错误
子模板继承的代码如下
<!-- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"><html lang="en"><head> <title>The Future time</title></head><body>{# {% include "include/nav.html" %} #}<h1>My helpful timestamp site</h1><p>it is will be {{next_time}} after {{hour_offset}}</p><hr><p>Thanks for visiting my site.</p> </body> </html> -->{%extends 'base/base.html'%}{%block title%} Future Time{%endblock%}{%block content%}<p> it is will be {{next_time}} after {{hour_offset}}</p>{%endblock%}
纠结了好长时间,然后根据错误信息,把未注释的代码放到开头,再试试,结果 ok了, 不知道Django
这样设计的目的。。醉了
如下子类继承
{%extends 'base/base.html'%}{%block title%} Future Time{%endblock%}{%block content%}<p> it is will be {{next_time}} after {{hour_offset}}</p>{%endblock%}<!-- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"><html lang="en"><head> <title>The Future time</title></head><body>{# {% include "include/nav.html" %} #}<h1>My helpful timestamp site</h1><p>it is will be {{next_time}} after {{hour_offset}}</p><hr><p>Thanks for visiting my site.</p> </body> </html> -->
刷新页面:
1 0
- Django:ExtendsNode: extends 'base/base.html'> must be the first tag in the template.
- [Django] Base class in the model layer
- django.template.base.TemplateDoesNotExist: test.html
- Constructor call must be the first statement in a constructor
- Constructor call must be the first statement in a constructor
- Constructor call must be the first statement in a constructor
- Constructor call must be the first statement in a constructor
- The base class cannot be designed
- must be initialized in constructor base/member initializer list
- error -5008: intel64 or amd64 must be specified in the template of the summary
- Unexpected XML declaration. The XML declaration must be the first node in the document and no white
- Constructor call must be the first statement in a constructor错误的理解
- Java异常解决:Constructor call must be the first statement in a constructor
- 有关Constructor call must be the first statement in a constructor的问题
- 有关Constructor call must be the first statement in a constructor的问题
- java问题——Constructor call must be the first statement in a constructor
- 关于类的继承Constructor call must be the first statement in a constructor问题
- Question 41: Which of the following operators must be overloaded by function objects in the Standard Template Library?
- 分布式缓存
- 从github上克隆的项目关联Git
- TextView中ellipsize属性
- 套接字地址
- setsockopt()用法(参数详细说明)
- Django:ExtendsNode: extends 'base/base.html'> must be the first tag in the template.
- X264移植android问题记录(No working C compiler found)
- 南阳oj 题目56 阶乘因式分解(一)
- MTK 平台Android系统遥控器映射关系
- 【cocos2d-x】引擎介绍
- windows下使用xShell向远程linux上传文件
- Smart SVN-使用Smart SVN 管理Xcode项目文件
- 2012年5月SAT香港真题解析
- redmine比较慢以及测试邮件发送完成收不到邮件