"Go" under Windows installation Flask

Source: Internet
Author: User
Tags virtual environment virtualenv

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
    1. From Flask Import flask
    2. App=flask (__name__)
    3. @app. Route ('/')
    4. Def hello_world ():
    5. return "Hello World"
    6. if __name__ = = ' __main__ ':
    7. 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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.