
Welcome to Flask — Flask Documentation (3.1.x)
¶ Welcome to Flask’s documentation. Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications. Get started with Installation and then get an overview with the Quickstart. There is also a more detailed Tutorial that shows how to create a small but complete application with …
Installation — Flask Documentation (3.1.x)
Installation Python Version ¶ We recommend using the latest version of Python. Flask supports Python 3.9 and newer. Dependencies ¶ These distributions will be installed automatically when installing Flask. Werkzeug implements WSGI, the standard Python interface between applications and servers. Jinja is a template language that renders the pages your application serves. …
Quickstart — Flask Documentation (3.1.x)
Quickstart ¶ Eager to get started? This page gives a good introduction to Flask. Follow Installation to set up a project and install Flask first. A Minimal Application ¶ A minimal Flask application looks something like this:
API — Flask Documentation (3.1.x)
API ¶ This part of the documentation covers all the interfaces of Flask. For parts where Flask depends on external libraries, we document the most important right here and provide links to the canonical documentation. Application Object ¶ class flask.Flask(import_name, static_url_path=None, static_folder='static', static_host=None, host_matching=False, …
Tutorial — Flask Documentation (3.1.x)
Contents: Project Layout Application Setup Define and Access the Database Blueprints and Views Templates Static Files Blog Blueprint Make the Project Installable Test Coverage Deploy to Production Keep Developing!
JavaScript, fetch, and JSON — Flask Documentation (3.1.x)
Making a Request with fetch ¶ fetch() takes two arguments, a URL and an object with other options, and returns a Promise. We won’t cover all the available options, and will only use then() on the promise, not other callbacks or await syntax. Read the linked MDN docs for more information about those features. By default, the GET method is used. If the response contains …
欢迎来到 Flask 的世界 — Flask Documentation (3.1.x)
Welcome to Flask's documentation. Flask is a lightweight WSGI web application framework. It is designed to make getting started quick and easy, with the ability to scale up to complex applications. Get started with 安装 and then get an overview with the Quickstart. There is also a more detailed 教程 that shows how to create a small but complete application with Flask. …
Deploy to Production — Flask Documentation (3.1.x)
Deploy to Production ¶ This part of the tutorial assumes you have a server that you want to deploy your application to. It gives an overview of how to create the distribution file and install it, but won’t go into specifics about what server or software to use. You can set up a new environment on your development computer to try out the instructions below, but probably shouldn’t use it ...
Uploading Files — Flask Documentation (3.1.x)
Uploading Files ¶ Ah yes, the good old problem of file uploads. The basic idea of file uploads is actually quite simple. It basically works like this: A <form> tag is marked with enctype=multipart/form-data and an <input type=file> is placed in that form. The application accesses the file from the files dictionary on the request object. use the save() method of the …
Project Layout — Flask Documentation (3.1.x)
Then follow the installation instructions to set up a Python virtual environment and install Flask for your project. The tutorial will assume you’re working from the flask-tutorial directory from now on. The file names at the top of each code block are relative to this directory.