2016-04-11 16:10:51 -07:00
|
|
|
.. _extensions:
|
|
|
|
|
|
2011-09-18 15:10:50 +02:00
|
|
|
Flask Extensions
|
|
|
|
|
================
|
|
|
|
|
|
|
|
|
|
Flask extensions extend the functionality of Flask in various different
|
|
|
|
|
ways. For instance they add support for databases and other common tasks.
|
|
|
|
|
|
|
|
|
|
Finding Extensions
|
|
|
|
|
------------------
|
|
|
|
|
|
|
|
|
|
Flask extensions are listed on the `Flask Extension Registry`_ and can be
|
2014-11-05 07:03:55 +03:00
|
|
|
downloaded with :command:`easy_install` or :command:`pip`. If you add a Flask extension
|
2014-11-05 06:46:22 +03:00
|
|
|
as dependency to your :file:`requirements.txt` or :file:`setup.py` file they are
|
2011-09-18 15:10:50 +02:00
|
|
|
usually installed with a simple command or when your application installs.
|
|
|
|
|
|
|
|
|
|
Using Extensions
|
|
|
|
|
----------------
|
|
|
|
|
|
|
|
|
|
Extensions typically have documentation that goes along that shows how to
|
|
|
|
|
use it. There are no general rules in how extensions are supposed to
|
|
|
|
|
behave but they are imported from common locations. If you have an
|
2016-04-02 21:06:30 +02:00
|
|
|
extension called ``Flask-Foo`` or ``Foo-Flask`` it should be always
|
|
|
|
|
importable from ``flask_foo``::
|
2011-09-18 15:10:50 +02:00
|
|
|
|
2016-04-02 21:06:30 +02:00
|
|
|
import flask_foo
|
2011-09-18 15:10:50 +02:00
|
|
|
|
2016-06-02 22:15:00 -07:00
|
|
|
Building Extensions
|
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
|
|
While `Flask Extension Registry`_ contains many Flask extensions, you may not find
|
2018-04-12 12:44:09 -07:00
|
|
|
an extension that fits your need. If this is the case, you can always create your own.
|
2016-06-02 22:15:00 -07:00
|
|
|
Consider reading :ref:`extension-dev` to develop your own Flask extension.
|
|
|
|
|
|
2011-09-18 15:10:50 +02:00
|
|
|
.. _Flask Extension Registry: http://flask.pocoo.org/extensions/
|