模板的for循环中,如何获取序号? 想过用enumerate,但是在模板中会报错 Could not parse the remainder xxx: 后来搜到 forloop.counter,完美解决 参考:http://www.cnblogs.com/chenkeven/articles/9340961.html…
问题 mysql 查询出现错误 error: (2014, "Commands out of sync; you can't run this command now") 查询 mysql文档中的解释 If you get Commands out of sync; you can't run this command now in your client code, you are calling client functions in the wrong order. This c…
python Django之Form组件 Django的Form主要具有一下几大功能: 生成HTML标签 验证用户数据(显示错误信息) HTML Form提交保留上次提交数据 初始化页面显示内容 小试牛刀 1.创建Form类 from django.forms import Form from django.forms import widgets from django.forms import fields class MyForm(Form): user = fields.CharFiel…
1.安装python环境 1.1 安装python包管理器: wget https://bootstrap.pypa.io/get-pip.py sudo python get-pip.py 1.2 安装python虚拟环境virtualenv virtualenvwrapper 首先说明下为什么要装这两个包: First, it's important to understand that a virtual environment is a special tool used to ke…
注: 由于自己排版确实很难看,本文开始使用markdown编辑,希望有所改善 官方定义 A model is the single, definitive source of information about your data. It contains the essential fields and behaviors of the data you're storing. Generally, each model maps to a single database table. 一个模…
#####20181225 1.python解决SNIMissingWarning和InsecurePlatformWarning警告在想要获取https站点的资源时,会报出SNIMissingWarning和InsecurePlatformWarning警告 SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not availa…