Skip to content
Myr

extensions.rst

This file

Path

docs/extensions.rst

58 lines · 2.1 KiB

Last changed by

resolve merge conflictsKenneth Reitzbefore adoption31174fe

History of this file

Take it

The walk stopped after 200 commits: lines older than 817b72d point at it.

resolve merge conflictsKenneth Reitzbefore adoption31174fe

lines 1–2why, one step back
1.. _extensions:
2

Removed deprecated module functionalityArmin Ronacherbefore adoption817b72d

lines 3–12why, one step back
3Flask Extensions
4================56Flask extensions extend the functionality of Flask in various different7ways. For instance they add support for databases and other common tasks.89Finding Extensions10------------------1112Flask extensions are listed on the `Flask Extension Registry`_ and can be

Merge pull request #1240 from defuz/docs-style-fix-2Markus Unterwaditzerbefore adoption6fcc2ae

lines 13–14why, one step back
13downloaded with :command:`easy_install` or :command:`pip`. If you add a Flask extension
14as dependency to your :file:`requirements.txt` or :file:`setup.py` file they are

Removed deprecated module functionalityArmin Ronacherbefore adoption817b72d

lines 15–22why, one step back
15usually installed with a simple command or when your application installs.
1617Using Extensions18----------------1920Extensions typically have documentation that goes along that shows how to21use it. There are no general rules in how extensions are supposed to22behave but they are imported from common locations. If you have an

resolve merge conflictsKenneth Reitzbefore adoption31174fe

lines 23–24why, one step back
23extension called ``Flask-Foo`` or ``Foo-Flask`` it should be always
24importable from ``flask_foo``::

Removed deprecated module functionalityArmin Ronacherbefore adoption817b72d

line 25why, one step back
25

resolve merge conflictsKenneth Reitzbefore adoption31174fe

line 26why, one step back
26 import flask_foo

Removed deprecated module functionalityArmin Ronacherbefore adoption817b72d

line 27why, one step back
27

resolve merge conflictsKenneth Reitzbefore adoption31174fe

lines 28–34why, one step back
28Building Extensions
29-------------------3031While `Flask Extension Registry`_ contains many Flask extensions, you may not find32an extension that fits your need. If this is the case, you can always create your own. 33Consider reading :ref:`extension-dev` to develop your own Flask extension.34

Removed deprecated module functionalityArmin Ronacherbefore adoption817b72d

lines 35–43why, one step back
35Flask Before 0.8
36----------------3738If you are using Flask 0.7 or earlier the :data:`flask.ext` package will not39exist, instead you have to import from ``flaskext.foo`` or ``flask_foo``40depending on how the extension is distributed. If you want to develop an41application that supports Flask 0.7 or earlier you should still import42from the :data:`flask.ext` package. We provide you with a compatibility43module that provides this package for older versions of Flask. You can

Merge pull request #1277 from iKevinY/doc-fixesMarkus Unterwaditzerbefore adoption82d7c49

line 44why, one step back
44download it from GitHub: `flaskext_compat.py`_

Removed deprecated module functionalityArmin Ronacherbefore adoption817b72d

lines 45–55why, one step back
45
46And here is how you can use it::4748 import flaskext_compat49 flaskext_compat.activate()5051 from flask.ext import foo5253Once the ``flaskext_compat`` module is activated the :data:`flask.ext` will54exist and you can start importing from there.55

resolve merge conflictsKenneth Reitzbefore adoption31174fe

line 56why, one step back
56

Removed deprecated module functionalityArmin Ronacherbefore adoption817b72d

line 57why, one step back
57.. _Flask Extension Registry: http://flask.pocoo.org/extensions/

resolve merge conflictsKenneth Reitzbefore adoption31174fe

line 58why, one step back
58.. _flaskext_compat.py: https://raw.githubusercontent.com/pallets/flask/master/scripts/flaskext_compat.py