extensions.rst
This file
Path
docs/extensions.rst
48 lines · 1.3 KiB
Last changed by
Merge remote-tracking branch 'origin/2.1.x'David Lordbefore adoption96d39c8
History of this fileTake it
1Extensions2==========34Extensions are extra packages that add functionality to a Flask5application. For example, an extension might add support for sending6email or connecting to a database. Some extensions add entire new7frameworks to help build certain types of applications, like a REST API.8910Finding Extensions11------------------1213Flask extensions are usually named "Flask-Foo" or "Foo-Flask". You can14search PyPI for packages tagged with `Framework :: Flask <pypi_>`_.151617Using Extensions18----------------1920Consult each extension's documentation for installation, configuration,21and usage instructions. Generally, extensions pull their own22configuration from :attr:`app.config <flask.Flask.config>` and are23passed an application instance during initialization. For example,24an extension called "Flask-Foo" might be used like this::2526 from flask_foo import Foo2728 foo = Foo()2930 app = Flask(__name__)31 app.config.update(32 FOO_BAR='baz',33 FOO_SPAM='eggs',34 )3536 foo.init_app(app)373839Building Extensions40-------------------4142While `PyPI <pypi_>`_ contains many Flask extensions, you may not find43an extension that fits your need. If this is the case, you can create44your own, and publish it for others to use as well. Read45:doc:`extensiondev` to develop your own Flask extension.464748.. _pypi: https://pypi.org/search/?c=Framework+%3A%3A+Flask