Flask Study (i) Overview and installation

Source: Internet
Author: User

Flask Overview and Installation

Flask Introduction

Flask is a lightweight WEB application framework written using Python. Its WSGI Toolbox uses Werkzeug, and the template engine uses JINJA2.

Official website: http://flask.pocoo.org/

Understanding Flask: First, Flask is a Web application framework for Python, and secondly, it is "micro".

Flask does not include the database abstraction layer, form validation, and so on, compared to the same kind of existing web frameworks (such as: Django). Flask is designed to keep the code simple and easy to expand (Flask source is very pythonic).

Flask supports extensions: Extensions can add functionality to your app, like the Flask itself. Numerous extensions provide features such as database integration, form validation, upload processing, and a variety of open authentication technologies.

Flask may be "micro" type, but it has been able to be used in a wide variety of requirements.

The "micro" in Microframework means Flask aims to keep the core is simple but extensible.

Pre-Foundation

Learn the techniques you need to have in the pre-Flask: Python language Foundation, Web Development Basics (HTML, CSS, JS, front-end framework, etc.), HTTP protocol, MVC Framework Basics (recommended)

The technology listed above, in addition to the Python language itself, is actually the Web developers need to understand the technology, may be different in the division of labor, the front-end correlation and will not understand very deep, but HTML tags, CSS style selector, box model and positioning, JS basic grammar, etc. still need to be familiar with and mastered.

The HTTP protocol is necessary for Web developers, depending on this blog post: http://blog.csdn.net/gueter/article/details/1524447

As for MVC, the target user of flask is not the kind of person trying to build a large MVC application, but it can be extended ^_^

Flask Installation

Python installed, pip install Flask cmd, can be installed offline http://pan.baidu.com/s/1o6oUu2u

Installation complete, pip list installation Flask required, JINJIA2 and Werkzeug

Flask "Hello World" example
1  fromFlaskImportFlask2App = Flask (__name__)3 4@app. Route ("/")5 defHello ():6     return "Hello world!"7 8 if __name__=="__main__":9App.run ()

The example code above, after running, will be on the localhost 5000 (i.e. http://127.0.0.0:5000) port. As follows:

    

A detailed description of the code is detailed in the following Flask learning chapters.

Flask Study (i) Overview and installation

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.