"Fossies" - the Fresh Open Source Software Archive

Member "flask-1.1.2/docs/extensions.rst" (3 Apr 2020, 1352 Bytes) of package /linux/www/flask-1.1.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field. See also the latest Fossies "Diffs" side-by-side code changes report for "extensions.rst": 1.1.1_vs_1.1.2.

Extensions

Extensions are extra packages that add functionality to a Flask application. For example, an extension might add support for sending email or connecting to a database. Some extensions add entire new frameworks to help build certain types of applications, like a REST API.

Finding Extensions

Flask extensions are usually named "Flask-Foo" or "Foo-Flask". You can search PyPI for packages tagged with Framework :: Flask.

Using Extensions

Consult each extension's documentation for installation, configuration, and usage instructions. Generally, extensions pull their own configuration from app.config <flask.Flask.config> and are passed an application instance during initialization. For example, an extension called "Flask-Foo" might be used like this:

from flask_foo import Foo

foo = Foo()

app = Flask(__name__)
app.config.update(
    FOO_BAR='baz',
    FOO_SPAM='eggs',
)

foo.init_app(app)

Building Extensions

While the PyPI contains many Flask extensions, you may not find an extension that fits your need. If this is the case, you can create your own. Read /extensiondev to develop your own Flask extension.