Development Environment Establishment of the Flask framework Learning Guide and flask Learning Guide
Flask is a lightweight Web application framework written in Python. Its WSGI toolbox uses Werkzeug, And the template engine uses Jinja2. Many functions are implemented based on the django framework. As required by the project, record the learning process and experience here.
To do well, you must first sharpen your tools. Let's start the flask journey from building a flask development environment.
I. Platform description
Operating System: window 7 64bit Database: mysql5.6 python: v2.7 integrated development software: PyCharm5.0
2. Development Environment Construction
1. Install the flask Framework Package
1) Open the windows command line:pip install flask
E: \ workdir \ blog2> pip install flask
Requirement already satisfied: flask in c: \ python27 \ lib \ site-packages
Requirement already satisfied: Jinja2 >=2.4 in c: \ python27 \ lib \ site-packages (from flask)
Requirement already satisfied: Werkzeug >=0.7 in c: \ python27 \ lib \ site-packages (from flask)
Requirement already satisfied: click> = 2.0 in c: \ python27 \ lib \ site-packages (from flask)
Requirement already satisfied: itsdangerous >=0.21 in c: \ python27 \ lib \ site-packages (from flask)
Requirement already satisfied: MarkupSafe in c: \ python27 \ lib \ site-packages (from Jinja2> = 2.4-> flask)
2) verify whether the installation is successful
E:\workdir\blog2>pythonPython 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license" for more information.>>>>>>>>> from flask import Flask>>>
If no error is reported when the flask package is imported, the installation of flask is successful.
2. Install the flask-sqlalchemy package
Flask-sqlalchemy what is this? Let's start with sqlalchemy. SQLAlchemy is an open-source software in the Python programming language. Provides the SQL Toolkit and Object Relational ing (ORM) tool. SQLAlchmey adopts a data ing model similar to Hibernate in Java. after its release in 2006, it became one of the most widely used ORM tools in the Python community, it is no less than Django's ORM framework.
The flask-sqlalchemy package is an extension that supports SQLAlchemy for the Flask application. It requires SQLAlchemy 0.6 or a later version. It is designed to simplify the use of SQLAlchemy in Flask, and provides useful default values and additional assistants to perform common tasks more easily.
1) first install sqlalchemy and open the windows command line:pip install sqlalchemy
E:\workdir\blog2>pip install sqlalchemy
2) install flask-sqlalchemy
E:\workdir\blog2>pip install flask-sqlalchemy
3) verify whether flask-sqlalchemy is successfully installed.
E:\workdir\blog2>pythonPython 2.7.10 (default, May 23 2015, 09:44:00) [MSC v.1500 64 bit (AMD64)] on win32Type "help", "copyright", "credits" or "license" for more information.>>>>>>>>>>>> from flask_sqlalchemy import SQLAlchemy>>>>>>
If no error is reported during package import, the installation is successful.
At this point, the development environment of flask has been completed, and the next article will carry out practical operations.
References:
[Flask Quick Start Chinese edition] http://docs.jinkan.org/docs/flask/
Flask Quick Start English edition http://flask.pocoo.org/docs/0.11/
Flask-sqlalchemy Chinese edition http://www.pythondoc.com/flask-sqlalchemy/index.html
Flask-sqlalchemy Chinese edition http://flask-sqlalchemy.pocoo.org/2.1/