最新 最热

flask 自定义表单验证器(flask 19)

from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, BooleanField, IntegerField, TextAreaField, SubmitField, MultipleFileField fr...

2019-08-13
0

flask 一个页面多个视图(flask 24)

{% extends 'base.html' %} {% from 'macros.html' import form_field %}

2019-08-13
0

flask 模板过滤器/测试器(flask 15)

default() escape :转义 first : 序列的第一个元素 last length : 长度 random : 从序列中随机获得某个 safe :不要转义 trim max/min/unique striptags:清除HTML标签 wordcount 计算单词数量 tojso......

2019-08-13
0

flask 钩子(flask 8)

@app.before_first_request def do(): print("before_first_request")

2019-08-13
0

flask 限定url的传参(flask 7)

colors=['blue','white','red'] @app.route('/colors/<any(%s):color>' % str(colors)[1:-1]) def ca(color): return color

2019-08-13
0

flask 获取URL(flask 4)

@app.route('/') def index(): return "aa"

2019-08-13
0

flask 设置环境变量 (flask 3)

1、在根目录下建立env文件夹,然后cd到该文件夹下 pip install pipenv pipenv install pipenv install flask pipenv install watchdog pipenv install python-dotenv

2019-08-13
1

flask URL值 (flask 2)

@app.route(&#x27;/hi/<int:year>&#x27;) @app.route(&#x27;/hello&#x27;,methods=[&#x27;GET&#x27;,&#x27;POST&#x27;]) @app.route(&#x27;/&#x27;,defaults={"name":"abc"}) @app.route(&#x27;/<name>&#x27;) def h...

2019-08-13
0

flask helloworld (flask 1)

@app.route('/hi') @app.route('/') def hello_world(): return 'Hello World!'

2019-08-13
0

flask 获取request对象的内容(flask 6)

@app.route("/req") def getreq(): name=request.args.get('name','flask') agent=request.user_agent headers=request.headers method=request.method referer=requ...

2019-08-13
0