上一页 1 2 3 4 5 6 7 8 9 10 ··· 13 下一页
摘要: 使用 from flask import Flask, render_template, request, redirect from wtforms import Form from wtforms.fields import core from wtforms.fields import htm 阅读全文
posted @ 2019-07-24 09:21 pdun 阅读(249) 评论(0) 推荐(0) 编辑
摘要: flask-script 使用 from flask_script import Manager app = Flask(__name__) manager=Manager(app) #直接实例化Manager把app传进去 ... if __name__ == '__main__': manage 阅读全文
posted @ 2019-07-23 08:19 pdun 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 一、介绍 组成部分 Dialect(方言) #SQLAlchemy本身无法操作数据库,其必须以来pymsql等第三方插件,Dialect用于和数据API进行交流,根据配置文件的不同调用不同的数据库API,从而实现对数据库的操作, #如: MySQL-Python mysql+mysqldb://<u 阅读全文
posted @ 2019-07-22 20:52 pdun 阅读(150) 评论(0) 推荐(0) 编辑
摘要: flask内置session flask-session 使用 阅读全文
posted @ 2019-07-22 16:35 pdun 阅读(211) 评论(0) 推荐(0) 编辑
摘要: local推导步骤 #不用local from threading import Thread import time lqz = -1 def task(arg): global lqz lqz = arg time.sleep(2) #最后显示9个相同的数字 print(lqz) for i i 阅读全文
posted @ 2019-07-18 15:03 pdun 阅读(288) 评论(0) 推荐(1) 编辑
摘要: 典型写法 默认转换器 DEFAULT_CONVERTERS = { 'default': UnicodeConverter, 'string': UnicodeConverter, #常用 'any': AnyConverter, 'path': PathConverter, 'int': Inte 阅读全文
posted @ 2019-07-18 10:13 pdun 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 一、请求扩展 from flask import Flask,request app=Flask(__name__) @app.before_request def process(): request.name='pdun' print('请求来的时候') @app.route('/') def 阅读全文
posted @ 2019-07-18 08:35 pdun 阅读(2159) 评论(0) 推荐(0) 编辑
摘要: 请求相关 响应相关 from flask import Flask,request app=Flask(__name__) @app.route('/',methods=['GET','POST']) def index(): print(request.args) #ImmutableMultiD 阅读全文
posted @ 2019-07-17 19:09 pdun 阅读(262) 评论(0) 推荐(0) 编辑
摘要: 模板简介 from flask import Flask,render_template app=Flask(__name__) @app.route('/') def index(): def text(): return '看看函数有没有触发执行' def add(a,b,c): return 阅读全文
posted @ 2019-07-17 14:47 pdun 阅读(217) 评论(0) 推荐(0) 编辑
摘要: 一、Flask了解 #flask是一个基于python开发并且依赖jinja2和Werkzeug服务的微型框架 对于werkzeug本质是socket服务端,其用于接收http请求并对请求进行预处理,然后触发flask框架,开发人员基于flask框架提供的功能对请求进行相应的处理,并返回给客户,如果 阅读全文
posted @ 2019-07-16 21:14 pdun 阅读(14663) 评论(0) 推荐(1) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 13 下一页