Installed under Windows Flask Original address: http://blog.csdn.net/qwiwuqo/article/details/8970621Flask introduction
is a lightweight Web application framework that is written using Python. Based on the Werkzeugwsgi Toolbox and the Jinja2 template engine.
FlaskUse BSD licensing. Flask is also known as "microframework" because it uses a simple core and adds other features with extension. Flask does not have the default database, form validation tools used. However, Flask retains the elasticity of amplification, which can be added with flask-extension: ORM, form validation tools, file uploads, various open authentication technologies.
Flask Installation Prerequisites 1. The python2.x version is installed
2. Easy_install installed
Before installing flask, you must first install Python and easy_install,easy_ Install only support pyhon2.x version does not support the python3.x version, so you have to install Python when the best choice python2.x, I was loaded with python3.3 before, so then to download Python2.7,python and easy _install installation I will not introduce, to the official website to download the version of the installation can be
This is the official website of Python:
http://www.python.org/
This is the website of download Easy_install
:http://pypi.python.org/pypi/setuptools 可以找到正确的版本进行下载。win7 32位可以下载setuptools-0.6c11.win32-py2.7.exe 。注意:win7 64位必须使用ez_setup.py进行安装。方法是下载ez_setup.py后,在cmd下执行 python ez_setup.py,即可自动安装setuptools。目前没有直接的exe安装版本。
After installing Easy_install, add the directory where the Easy_install is located in the path of the system environment variable, for example: C:\Python27\Scripts
Start installation
If you have Python2.7 and East_install all installed, then we can install flask.
First open the console
Input Easy_install virtualenv, install virtualenv, this is mainly used to do the interpreter environment isolation, avoid multiple python on the same machine or multiple Python library dependencies
Then configure the virtual environment
You see, there's one more file in the F drive. Myvir
Then CD to the Myvir directory under scripts
Enter Activate.bat, enter the virtual environment, then enter Easy_install Flask
After the installation is complete, let's test to see if it works.
Create a new text file under scripts and enter the following:
[Python]View Plaincopy
- From Flask Import flask
- App=flask (__name__)
- @app. Route ('/')
- Def hello_world ():
- return "Hello World"
- if __name__ = = ' __main__ ':
- App.run ()
Save As Hello.py
Finally, enter the Python hello.py on the console
Then open the browser input 127.0.0.1:5000 and see Hello World.
"Go" under Windows installation Flask