视图函数选项对内部使用,视图函数可以有一些属性,附加到视图函数通常没有控制权的自定义的 行为。下面的可选属性覆盖
完整的例子: def index():
if request.method == 'OPTIONS':
# custom options handling here
...
return 'Hello World!'
index.provide_automatic_options = False
index.methods = ['GET', 'OPTIONS']
app.add_url_rule('/', index)
0.8 新版功能: 加入了 provide_automatic_options 功能。 |
Archiver|手机版|笨鸟自学网 ( 粤ICP备20019910号 )
GMT+8, 2025-8-31 00:52 , Processed in 0.019937 second(s), 19 queries .
Powered by Discuz! X3.5
© 2001-2017 Discuz Team. Template By 【未来科技】【 www.wekei.cn 】