“Flask基础”的版本间的差异

来自linux中国网wiki
跳到导航 跳到搜索
(创建页面,内容为“ =install = <pre> mkdir myproject $ cd myproject $ python3 -m venv venv . venv/bin/activate $ pip install Flask vi hello.py from flask import Flask app = Fl…”)
 
 
(未显示同一用户的4个中间版本)
第36行: 第36行:
 
</pre>
 
</pre>
  
 +
=cmdb=
 +
[[Cmdb#flask_cmdb|flask_cmdb]]
 
=see also=
 
=see also=
 
[https://flask.palletsprojects.com/en/2.0.x/quickstart/ flask quickstart]
 
[https://flask.palletsprojects.com/en/2.0.x/quickstart/ flask quickstart]
 +
 +
[https://my.oschina.net/liuzhijun/blog/4622003 吐血推荐珍藏的Flask资源]
 +
 +
[https://www.oschina.net/p/flask  Flask 微型Python框架 oschina]
 +
 +
 +
[https://my.oschina.net/u/4638454/blog/5161961  Flask结合ECharts实现在线可视化效果,超级详细!]
 +
[[category:flask]]  [[category:devops]]

2021年8月10日 (二) 13:58的最新版本


install


mkdir myproject
$ cd myproject
$ python3 -m venv venv

. venv/bin/activate

$ pip install Flask


vi hello.py

from flask import Flask

app = Flask(__name__)

@app.route("/")
def hello_world():
    return "<p>Hello, World!</p>"

flask  run 
 * Serving Flask app 'hello' (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)

Now head over to http://127.0.0.1:5000/, and you should see your hello world greeting.

cmdb

flask_cmdb

see also

flask quickstart

吐血推荐珍藏的Flask资源

Flask 微型Python框架 oschina


Flask结合ECharts实现在线可视化效果,超级详细!