Django TemplateSyntaxError Could not parse the remainder: '()'
返回的数据是列表集合,如
n [5]: a = set() In [6]: a.add((1, 3)) In [7]: a
Out[7]: {(1, 3)}
在模板中使用方式如下:
{% for archive in archive_lists %}
<li>
<a href="/archive/{{ archive.0 }}/{{ archive.1 }} ">{{ archive }}</a>
</li>
{% endfor %}
参考见:
http://stackoverflow.com/questions/5231171/django-templatesyntaxerror-could-not-parse-the-remainder
Django TemplateSyntaxError Could not parse the remainder: '()'的更多相关文章
- cnblog项目--20190309
第一个真正意义的Django项目 ! 预计时间5天 20190309--20190314 目标:学会Django的使用,理解模块关系! querset 相当于一个存放列表的字典 day ...
- The Django template language 阅读批注
The Django template language About this document This document explains the language syntax of the D ...
- django for 循环中,获取序号
模板的for循环中,如何获取序号? 想过用enumerate,但是在模板中会报错 Could not parse the remainder xxx: 后来搜到 forloop.counter,完美解 ...
- django.template.exceptions.TemplateSyntaxError: 'article_tags' is not a registered tag library.
django.template.exceptions.TemplateSyntaxError: 'article_tags' is not a registered tag library. Must ...
- django.template.exceptions.TemplateSyntaxError: 'static' is not a registered tag library. Must be one of:
在访问web页面时报错,详细日志如下: django.template.exceptions.TemplateSyntaxError: 'staticfiles' is not a registere ...
- Django 自定义模板标签 报错django.template.exceptions.TemplateSyntaxError: '####' is not a registered tag library. Must be one of:
我写代码遇到这个错误,但是发现程序没有写错,好像是程序有缓存,重新运行几次就好了. 自定义模板标签,可以不用写views,url直接通过自定义函数把变量传给模板. 具体实现: 1.在app下新建Pyt ...
- django 补充篇
from验证 django中的Form一般有两种功能: 输入html-----------不能你自己写一些标签,而帮你自动生成 验证用户输入-------将用户验证信息保存起来,可以传到前端 # !/ ...
- Django 模版语言详解
一.简介 模版是纯文本文件.它可以产生任何基于文本的的格式(HTML,XML,CSV等等). 模版包括在使用时会被值替换掉的 变量,和控制模版逻辑的 标签. 例: {% extends "b ...
- django 的模板语言
1.模版的执行 模版的创建过程,对于模版,其实就是读取模版(其中嵌套着模版标签),然后将 Model 中获取的数据插入到模版中,最后将信息返回给用户. def current_datetime(req ...
随机推荐
- 数据字典生成工具之旅(3):PowerDesign文件组成结构介绍及操作
从这篇开始将正式讲解整个重要部分的实现细节,本篇讲解Pdm文件的解析.其实PDM文件就是XML文件,可以用Editplus或者VS打开查看.了解到这一点之后大家就能猜到,可以用解析XML的方式读取PD ...
- Android闹钟设置的解决方案
Android设置闹钟并不像IOS那样这么简单,做过Android设置闹钟的开发者都知道里面的坑有多深.下面记录一下,我解决Android闹钟设置的解决方案. 主要问题 API19开始AlarmMan ...
- 20140207 - Java and Mac OS X Retina
在Mac下使用文件管理工具类似Total Commander的muCommander,muCommander的编写语言是Java,打开后发现Java不兼容Mac Retina. muCommander ...
- js前端分页
转载:http://www.cnblogs.com/lyzg/p/5791011.html http://www.cnblogs.com/m-m-g-y0416/p/5601903.html
- [Codevs1403]新三国争霸(MST+DP)
题目:http://codevs.cn/problem/1403/ 分析: 很容易想到对于某个确定的一天,就是求个最小生成树,又因为数据范围很小,所以可以暴力.但问题的关键是如果相邻两天的方案不同,就 ...
- scrollTop和offsetTop的区别,scrollTopLeft和offsetLeft的区别
scrollTop和offsetTop的区别:scrollTop是指某个可滚动区块向下滚动的距离,比如向下滚动了10个像素,那么这个元素的scrollTop属性值就是10,这个属性的值是可读写的,且不 ...
- Java Little Knowledge
1.Constructor running order of Base class and Derived class This is Alibaba's audition problem. clas ...
- 《HTTP 权威指南》
第一篇: Web基础 (HTTP概述. URL.HTTP报文.连接管理) 0. scheme:方案! 协议类型 1.HTTP:超文本传输(状态转移)协议:通信协议方案. web浏览 ...
- Android M 控件:Snackbar、Toolbar、TabLayout、NavigationView
Snackbar Snackbar提供了一个介于Toast和AlertDialog之间轻量级控件,它可以很方便的提供消息的提示和动作反馈.Snackbar的使用与Toast的使用基本相同: Snack ...
- asp.net mvc 多级目录结构
ikmb@163.com ASP.NET MVC默认的文件组织和URL访问都是一级,我们通常要将一个功能模块组织到一个目录下.方法是:1.文件组织 分别在Controllers和Views文件夹下建议 ...