英语讲课笔记11(Play with Flask)"/>
计算机英语讲课笔记11(Play with Flask)
文章目录
- 1. Flask's Documentation
- 2. Installation of Flask
- (1) Create an environment
- (2) Activate the environment
- (3) Install Flask
- 3. Quick Start - 快速起步
- (1) A Minimal Application
- (2) Create and Visit a Template
1. Flask’s Documentation
- .1.x/
2. Installation of Flask
- .1.x/installation/
- We recommend using the latest version of Python. The current version of Python is 3.10.5
- Flask supports
Python 3.7 and newer
. - Check the version of Python on your computer.
- It shows that Flask can be used on your computer.
(1) Create an environment
- Look at the instruction in the document.
- Let’s view the directory structure of the project - flaskdemo
(2) Activate the environment
- Look at the instruction in the document.
- We follow the instruction above.
- Type the command and then press the Enter key
(3) Install Flask
- Look at the instruction in the document.
- We follow the instruction above.
- Upgrade
pip
from19.2.3
to22.1.2
3. Quick Start - 快速起步
- .1.x/quickstart/
(1) A Minimal Application
- Use PyCharm to open the flask project -
flaskdemo
- Create a Python file named
main.py
- Write the code in the main.py
- Run the program and look at the result.
- Visit
http://localhost:8888
in the browser.
(2) Create and Visit a Template
- Create a template named
welcome.html
- Modify the main.py to create a new router function named
welcome
.
- Run the program again and visit
http://localhost:8888/welcome
in the browser.
更多推荐
计算机英语讲课笔记11(Play with Flask)
发布评论