Python: Flask is a micro webdevelopment framework for Python.
Example#!/usr/bin/env python# encoding: utf-8from flask import Flaskapp = Flask(__name__)@app.route('/')def index():return 'hello world'if __name__ == '__main__':app.run(debug=Tru
·
Example
#!/usr/bin/env python
# encoding: utf-8
from flask import Flask
app = Flask(__name__)
@app.route('/')
def index():
return 'hello world'
if __name__ == '__main__':
app.run(debug=True)
#app.run(host='127.0.0.1', port=8000)
#!/usr/bin/env python
# encoding: utf-8
from flask import Flask
from flask import Request
class FooRequest(Request):
"""
"""
want_form_data_parsed = False
app = Flask("FOO", static_folder=None)
app.request_class = FooRequest
app.config.from_pyfile("/path/to/config.py")
app.config.get("foo")
app.add_url_rule(rule="/<path:path>", view_func=request_dispatcher,
methods=["HEAD", "GET", "POST", "PUT", "DELETE", "OPTIONS"])
app.add_url_rule(rule="/", view_func=request_dispatcher,
methods=["HEAD", "GET", "POST", "PUT", "DELETE", "OPTIONS"])
if __name__ == '__main__':
app.run(debug=True)
更多推荐
已为社区贡献2条内容
所有评论(0)