随笔分类 - tornado
python的tornado框架
摘要:''' 方法一: data: { 'teamid': teamid, csrfmiddlewaretoken: '{{ csrf_token }}' //data: {name: 'john', csrfmiddlewaretoken: '{{ csrf_token }}'}, } 方法二: //获
阅读全文
摘要:centos自带的python版本为2.6,在使用tornado时会出现如下报错: NameError: global name 'memoryview' is not defined 因此需要升级到python2.7,升级过程出现如下问题: 升级到2.7: 1.下载安装包、解压安装: wget h
阅读全文
摘要:1.pip install pycket 2.pip install redis 防止xsrf攻击只需在模板form标签加入: {% module xsrf_form_html() %} <!DOCTYPE html> <html lang="en"> <head> <meta charset="U
阅读全文
摘要:#coding:utf-8 import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web import time from tornado.options import define
阅读全文
摘要:#coding:utf-8 import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web import time from tornado.options import define
阅读全文
摘要:from datetime import datetime from sqlalchemy import Column,Integer,String,Boolean,DateTime,ForeignKey from sqlalchemy.orm import relationship from .c
阅读全文
摘要:##导入模块:import syssys.path.append('../modules')存在modluesa.pyfrom moudlesa import aa ##导入包(文件夹)#包下面必须加__init__.py文件,(init里面写的内容可直接作为包加.的属性和方法,大多数情况下为空)p
阅读全文
摘要:sqlalchemy 1.pip install sqlalchemy 2.pip install pymsql connect.py ''' sqlalchemy ''' from sqlalchemy import create_engine HOSTNAME='127.0.0.1' PORT=
阅读全文
摘要:## 06ui.py #coding:utf-8 import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web from tornado.options import define,options import util.ui_methods import util.ui_m...
阅读全文
摘要:## 06ui.py #coding:utf-8 import tornado.httpserver import tornado.ioloop import tornado.options import tornado.web from tornado.options import define,
阅读全文
摘要:继承:模板继承使用extends标签实现。通过使用block来给子模板开放接口。1、extends必须是模板中的第一个出现的标签。2、子模板中的所有内容,必须出现在父模板定义好的block中,否则tornado将不会渲染。3、如果出现重复代码,就应该考虑使用模板。4、尽可能多的定义block,方便子
阅读全文
摘要:1 #test04.py 2 import tornado.httpserver 3 import tornado.ioloop 4 import tornado.options 5 import tornado.web 6 7 from tornado.options import define,
阅读全文

浙公网安备 33010602011771号