Skip to content
Myr

extensions.rst

This file

Path

docs/extensions.rst

53 lines · 1.5 KiB

Last changed by

Merge branch '1.0.x'David Lordbefore adoption2236ba9

History of this file

Take it

1.. _extensions:23Extensions4==========56Extensions are extra packages that add functionality to a Flask7application. For example, an extension might add support for sending8email or connecting to a database. Some extensions add entire new9frameworks to help build certain types of applications, like a REST API.101112Finding Extensions13------------------1415Flask extensions are usually named "Flask-Foo" or "Foo-Flask". Many16extensions are listed in the `Extension Registry`_, which can be updated17by extension developers. You can also search PyPI for packages tagged18with `Framework :: Flask <pypi_>`_.192021Using Extensions22----------------2324Consult each extension's documentation for installation, configuration,25and usage instructions. Generally, extensions pull their own26configuration from :attr:`app.config <flask.Flask.config>` and are27passed an application instance during initialization. For example,28an extension called "Flask-Foo" might be used like this::2930    from flask_foo import Foo3132    foo = Foo()3334    app = Flask(__name__)35    app.config.update(36        FOO_BAR='baz',37        FOO_SPAM='eggs',38    )3940    foo.init_app(app)414243Building Extensions44-------------------4546While the `Extension Registry`_ contains many Flask extensions, you may47not find an extension that fits your need. If this is the case, you can48create your own. Read :ref:`extension-dev` to develop your own Flask49extension.505152.. _Extension Registry: http://flask.pocoo.org/extensions/53.. _pypi: https://pypi.org/search/?c=Framework+%3A%3A+Flask