Building the Flask framework in Windows is divided into the following steps
1. Download the ez_setup.py file and execute it in cmd
Link: http://pan.baidu.com/s/1qXOSeHu Password: JKBW
Python ez_setup.py
2. Locate the Python installation directory, locate the Scripts folder, and add the path of the secondary folder to the environment variable.
3. Perform the install Pip in cmd
Easy_install pip
4. Installing virtualenv
Pip Install Virtualenv
5. Create a folder, the Flask Project Project (My_project)
6. Open the My_project directory in cmd
7. Execute Virtualenv venv, at which point a venv folder will be found in the My_project folder
Virtualenv venv
8. Finally execute in CMD
Pip Install flask
9. Open the My_project project with Eclipse or pycharm at this point.
10. Create a new Python file under the project, hello.py inside the contents as follows
From flask import Flaskapp = Flask (__name__) @app. Route ("/") def hello (): return ' Hello World ' if __name__ = = "__main__": app.run ()
Flask Environment Building under windows