Overview:
Flask is a lightweight WEB application framework written using Python. The WSGI Toolkit uses WERKZEUG, and the template engine uses JINJA2 (similar to the Smarty in PHP, designed to allow the program to separate the interface from the data). Flask uses BSD licensing.
WSGI (Python Web server Gateway Interface) is an interface between a Python application or a framework and a WEB server that has been widely accepted. Similar to the Servelet API in Java.
Installation steps:
1. Install Pip
Execute distribute_setup.py, there will be easy_install under Python scripts, use this script to install PIP
Easy_install pip
2. Installing virtualenv
Virtualenv can create a Python virtual environment, and the environment between the different projects can not conflict. Specific Introduction View: http://www.cnblogs.com/harrychinese/archive/2012/01/09/use_virtualenv_on_windows.html
Pip Install "Virtualenv < 1.11"
Install the version prior to 1.11, or there will be a bug.
3. Create a virtual environment
Create a new project directory and execute it under the new directory:
Virtualenv my_project or python-m virtualenv my_project
When the above command is complete, a new directory My_project is created, as well as a new Python development environment. Then install flask under My_project:
Pip Install Flask
Several problems encountered in the construction process:
Http://askubuntu.com/questions/400343/trying-to-create-a-python-virtual-environment-but-getting-oserror
Http://stackoverflow.com/questions/23523812/fatal-error-when-using-scripts-through-virtualenv-extra-quotes-around-python-e
Http://stackoverflow.com/questions/20925329/trouble-with-creating-a-virtual-environment-in-windows-8-python-3-3
4. Switching the environment
After you create a virtual environment for a project by using virtualenv, you need to activate the environment before you can run this project
Venv\scripts\activate
Venv is the project name
Flask Environment Construction