Home >Backend Development >Python Tutorial >what is python flask

what is python flask

藏色散人
藏色散人Original
2019-06-21 10:53:394388browse

what is python flask

Flask is a lightweight web application framework written in Python. Its WSGI toolbox uses Werkzeug and its template engine uses Jinja2. Flask is licensed under BSD.

Flask is also called a "microframework" because it uses a simple core and uses extensions to add other features. Flask does not have a default database or form validation tool.

Related recommendations: "Python Tutorial"

However, Flask retains the flexibility of expansion, and you can use Flask-extension to add these functions:

ORM, form validation tools, file uploads, various open authentication technologies. The latest version is 1.0.2

Flask is simple and easy to learn. Here is the Flask version of hello world(hello.py):

from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():    
    return "Hello World!"
 
if __name__ == "__main__":
    app.run()

Install flask and you can run it:

$ pip install Flask
 
$ python
hello.py* Running on http://localhost:5000/
 
*flask默认端口是5000

The above is the detailed content of what is python flask. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn