extensiondev.rst
This file
Path
docs/extensiondev.rst
421 lines · 16.3 KiB
Last changed by
Merge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption2e816f5
History of this fileTake it
The walk stopped after 200 commits: lines older than fbd6776 point at it.
Added documentation for appcontext and teardown handlersArmin Ronacherbefore adoption9bed20c
lines 1–2why, one step back1.. _extension-dev:2Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 3–20why, one step back3Flask Extension Development4===========================56Flask, being a microframework, often requires some repetitive steps to get7a third party library working. Because very often these steps could be8abstracted to support multiple projects the `Flask Extension Registry`_9was created.1011If you want to create your own Flask extension for something that does not12exist yet, this guide to extension development will help you get your13extension running in no time and to feel like users would expect your14extension to behave.1516.. _Flask Extension Registry: http://flask.pocoo.org/extensions/1718Anatomy of an Extension19-----------------------20Documented new import system for extensionsArmin Ronacherbefore adoption0719ad5
line 21why, one step back21Extensions are all located in a package called ``flask_something``Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 22–23why, one step back22where "something" is the name of the library you want to bridge. So for23example if you plan to add support for a library named `simplexml` toDocumented new import system for extensionsArmin Ronacherbefore adoption0719ad5
line 24why, one step back24Flask, you would name your extension's package ``flask_simplexml``.Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 25–31why, one step back2526The name of the actual extension (the human readable name) however would27be something like "Flask-SimpleXML". Make sure to include the name28"Flask" somewhere in that name and that you check the capitalization.29This is how users can then register dependencies to your extension in30their `setup.py` files.31Documented new import system for extensionsArmin Ronacherbefore adoption0719ad5
lines 32–36why, one step back32Flask sets up a redirect package called :data:`flask.ext` where users33should import the extensions from. If you for instance have a package34called ``flask_something`` users would import it as35``flask.ext.something``. This is done to transition from the old36namespace packages. See :ref:`ext-import-transition` for more details.Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 37–42why, one step back3738But how do extensions look like themselves? An extension has to ensure39that it works with multiple Flask application instances at once. This is40a requirement because many people will use patterns like the41:ref:`app-factories` pattern to create their application as needed to aid42unittests and to support multiple configurations. Because of that it isUse American English for "behavior" in docs.Ron DuPlainbefore adoptiona3cb2a3
line 43why, one step back43crucial that your application supports that kind of behavior.Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 44–49why, one step back4445Most importantly the extension must be shipped with a `setup.py` file and46registered on PyPI. Also the development checkout link should work so47that people can easily install the development version into their48virtualenv without having to download the library by hand.49Merge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption2e816f5
lines 50–53why, one step back50Flask extensions must be licensed under a BSD, MIT or more liberal license51to be able to be enlisted in the Flask Extension Registry. Keep in mind52that the Flask Extension Registry is a moderated place and libraries will53be reviewed upfront if they behave as required.Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 54–63why, one step back5455"Hello Flaskext!"56-----------------5758So let's get started with creating such a Flask extension. The extension59we want to create here will provide very basic support for SQLite3.6061First we create the following folder structure::6263 flask-sqlite3/Documented new import system for extensionsArmin Ronacherbefore adoption0719ad5
line 64why, one step back64 flask_sqlite3.pyFixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
line 65why, one step back65 LICENSEDocumented new import system for extensionsArmin Ronacherbefore adoption0719ad5
line 66why, one step back66 READMEFixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 67–94why, one step back6768Here's the contents of the most important files:6970setup.py71````````7273The next file that is absolutely required is the `setup.py` file which is74used to install your Flask extension. The following contents are75something you can work with::7677 """78 Flask-SQLite379 -------------8081 This is the description for that library82 """83 from setuptools import setup848586 setup(87 name='Flask-SQLite3',88 version='1.0',89 url='http://example.com/flask-sqlite3/',90 license='BSD',91 author='Your Name',92 author_email='your-email@example.com',93 description='Very short description',94 long_description=__doc__,Documented new import system for extensionsArmin Ronacherbefore adoption0719ad5
lines 95–98why, one step back95 py_modules=['flask_sqlite3'],96 # if you would be using a package instead use packages instead97 # of py_modules:98 # packages=['flask_sqlite3'],Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
line 99why, one step back99 zip_safe=False,Documented new import system for extensionsArmin Ronacherbefore adoption0719ad5
line 100why, one step back100 include_package_data=True,Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 101–116why, one step back101 platforms='any',102 install_requires=[103 'Flask'104 ],105 classifiers=[106 'Environment :: Web Environment',107 'Intended Audience :: Developers',108 'License :: OSI Approved :: BSD License',109 'Operating System :: OS Independent',110 'Programming Language :: Python',111 'Topic :: Internet :: WWW/HTTP :: Dynamic Content',112 'Topic :: Software Development :: Libraries :: Python Modules'113 ]114 )115116That's a lot of code but you can really just copy/paste that from existingDocumented new import system for extensionsArmin Ronacherbefore adoption0719ad5
line 117why, one step back117extensions and adapt.Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
line 118why, one step back118Documented new import system for extensionsArmin Ronacherbefore adoption0719ad5
lines 119–120why, one step back119flask_sqlite3.py120````````````````Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 121–129why, one step back121122Now this is where your extension code goes. But how exactly should such123an extension look like? What are the best practices? Continue reading124for some insight.125126Initializing Extensions127-----------------------128129Many extensions will need some kind of initialization step. For example,Merge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption3249eeb
lines 130–131why, one step back130consider an application that's currently connecting to SQLite like the131documentation suggests (:ref:`sqlite3`). So how does the extensionFixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 132–138why, one step back132know the name of the application object?133134Quite simple: you pass it to it.135136There are two recommended ways for an extension to initialize:137138initialization functions:Merge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption3249eeb
line 139why, one step back139Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 140–145why, one step back140 If your extension is called `helloworld` you might have a function141 called ``init_helloworld(app[, extra_args])`` that initializes the142 extension for that application. It could attach before / after143 handlers etc.144145classes:Merge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption3249eeb
line 146why, one step back146Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
line 147why, one step back147 Classes work mostly like initialization functions but can later beUse American English for "behavior" in docs.Ron DuPlainbefore adoptiona3cb2a3
line 148why, one step back148 used to further change the behavior. For an example look at how theFixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 149–153why, one step back149 `OAuth extension`_ works: there is an `OAuth` object that provides150 some helper functions like `OAuth.remote_app` to create a reference to151 a remote application that uses OAuth.152153What to use depends on what you have in mind. For the SQLite 3 extensionMerge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption3249eeb
lines 154–155why, one step back154we will use the class-based approach because it will provide users with an155object that handles opening and closing database connections.Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
line 156why, one step back156Added documentation for appcontext and teardown handlersArmin Ronacherbefore adoption9bed20c
lines 157–161why, one step back157What's important about classes is that they encourage to be shared around158on module level. In that case, the object itself must not under any159circumstances store any application specific state and must be shareable160between different application.161Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 162–164why, one step back162The Extension Code163------------------164Documented new import system for extensionsArmin Ronacherbefore adoption0719ad5
line 165why, one step back165Here's the contents of the `flask_sqlite3.py` for copy/paste::Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 166–168why, one step back166167 import sqlite3168Added documentation for appcontext and teardown handlersArmin Ronacherbefore adoption9bed20c
lines 169–175why, one step back169 # Find the stack on which we want to store the database connection.170 # Starting with Flask 0.9, the _app_ctx_stack is the correct one,171 # before that we need to use the _request_ctx_stack.172 try:173 from flask import _app_ctx_stack as stack174 except ImportError:175 from flask import _request_ctx_stack as stackFixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
line 176why, one step back176Merge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption3249eeb
line 177why, one step back177Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 178–179why, one step back178 class SQLite3(object):179Merge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption3249eeb
lines 180–187why, one step back180 def __init__(self, app=None):181 if app is not None:182 self.app = app183 self.init_app(self.app)184 else:185 self.app = None186187 def init_app(self, app):Added documentation for appcontext and teardown handlersArmin Ronacherbefore adoption9bed20c
lines 188–194why, one step back188 app.config.setdefault('SQLITE3_DATABASE', ':memory:')189 # Use the newstyle teardown_appcontext if it's available,190 # otherwise fall back to the request context191 if hasattr(app, 'teardown_appcontext'):192 app.teardown_appcontext(self.teardown)193 else:194 app.teardown_request(self.teardown)Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 195–198why, one step back195196 def connect(self):197 return sqlite3.connect(self.app.config['SQLITE3_DATABASE'])198Added documentation for appcontext and teardown handlersArmin Ronacherbefore adoption9bed20c
lines 199–202why, one step back199 def teardown(self, exception):200 ctx = stack.top201 if hasattr(ctx, 'sqlite3_db'):202 ctx.sqlite3_db.close()Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
line 203why, one step back203Merge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption3249eeb
lines 204–205why, one step back204 @property205 def connection(self):Added documentation for appcontext and teardown handlersArmin Ronacherbefore adoption9bed20c
line 206why, one step back206 ctx = stack.topFixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
line 207why, one step back207 if ctx is not None:Added documentation for appcontext and teardown handlersArmin Ronacherbefore adoption9bed20c
lines 208–209why, one step back208 if not hasattr(ctx, 'sqlite3_db'):209 ctx.sqlite3_db = self.connect()Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 210–211why, one step back210 return ctx.sqlite3_db211Merge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption3249eeb
line 212why, one step back212Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 213–214why, one step back213So here's what these lines of code do:214Merge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption3249eeb
lines 215–221why, one step back2151. The ``__init__`` method takes an optional app object and, if supplied, will216 call ``init_app``.2172. The ``init_app`` method exists so that the ``SQLite3`` object can be218 instantiated without requiring an app object. This method supports the219 factory pattern for creating applications. The ``init_app`` will set the220 configuration for the database, defaulting to an in memory database if221 no configuration is supplied. In addition, the ``init_app`` method attachesAdded documentation for appcontext and teardown handlersArmin Ronacherbefore adoption9bed20c
lines 222–224why, one step back222 the ``teardown`` handler. It will try to use the newstyle app context223 handler and if it does not exist, falls back to the request context224 one.Merge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption3249eeb
line 225why, one step back2253. Next, we define a ``connect`` method that opens a database connection.Added documentation for appcontext and teardown handlersArmin Ronacherbefore adoption9bed20c
line 226why, one step back2264. Finally, we add a ``connection`` property that on first access opensMore documentation updates for 0.9Armin Ronacherbefore adoption52f9cef
lines 227–229why, one step back227 the database connection and stores it on the context. This is also228 the recommended way to handling resources: fetch resources lazily the229 first time they are used.Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
line 230why, one step back230Added documentation for appcontext and teardown handlersArmin Ronacherbefore adoption9bed20c
lines 231–237why, one step back231 Note here that we're attaching our database connection to the top232 application context via ``_app_ctx_stack.top``. Extensions should use233 the top context for storing their own information with a sufficiently234 complex name. Note that we're falling back to the235 ``_request_ctx_stack.top`` if the application is using an older236 version of Flask that does not support it.237Merge pull request #392 from FND/docsRon DuPlainbefore adoption7ba5196
line 238why, one step back238So why did we decide on a class-based approach here? Because using ourFixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 239–241why, one step back239extension looks something like this::240241 from flask import FlaskDocumented new import system for extensionsArmin Ronacherbefore adoption0719ad5
line 242why, one step back242 from flask_sqlite3 import SQLite3Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 243–245why, one step back243244 app = Flask(__name__)245 app.config.from_pyfile('the-config.cfg')Merge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption3249eeb
line 246why, one step back246 db = SQLite3(app)Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 247–251why, one step back247248You can then use the database from views like this::249250 @app.route('/')251 def show_all():Merge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption3249eeb
line 252why, one step back252 cur = db.connection.cursor()Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 253–254why, one step back253 cur.execute(...)254Added an example for using the db connection without the requestArmin Ronacherbefore adoption32f845e
lines 255–265why, one step back255Likewise if you are outside of a request but you are using Flask 0.9 or256later with the app context support, you can use the database in the same257way::258259 with app.app_context():260 cur = db.connection.cursor()261 cur.execute(...)262263At the end of the `with` block the teardown handles will be executed264automatically.265Merge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption3249eeb
lines 266–267why, one step back266Additionally, the ``init_app`` method is used to support the factory pattern267for creating apps::Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
line 268why, one step back268Merge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption3249eeb
lines 269–272why, one step back269 db = Sqlite3()270 # Then later on.271 app = create_app('the-config.cfg')272 db.init_app(app)Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
line 273why, one step back273Merge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption3249eeb
lines 274–275why, one step back274Keep in mind that supporting this factory pattern for creating apps is required275for approved flask extensions (described below).Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
line 276why, one step back276Added documentation for appcontext and teardown handlersArmin Ronacherbefore adoption9bed20c
line 277why, one step back277.. admonition:: Note on ``init_app``Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
line 278why, one step back278Added documentation for appcontext and teardown handlersArmin Ronacherbefore adoption9bed20c
lines 279–283why, one step back279 As you noticed, ``init_app`` does not assign ``app`` to ``self``. This280 is intentional! Class based Flask extensions must only store the281 application on the object when the application was passed to the282 constructor. This tells the extension: I am not interested in using283 multiple applications.Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
line 284why, one step back284Added documentation for appcontext and teardown handlersArmin Ronacherbefore adoption9bed20c
lines 285–288why, one step back285 When the extension needs to find the current application and it does286 not have a reference to it, it must either use the287 :data:`~flask.current_app` context local or change the API in a way288 that you can pass the application explicitly.Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 289–290why, one step back289290Added documentation for appcontext and teardown handlersArmin Ronacherbefore adoption9bed20c
lines 291–309why, one step back291Using _app_ctx_stack292--------------------293294In the example above, before every request, a ``sqlite3_db`` variable is295assigned to ``_app_ctx_stack.top``. In a view function, this variable is296accessible using the ``connection`` property of ``SQLite3``. During the297teardown of a request, the ``sqlite3_db`` connection is closed. By using298this pattern, the *same* connection to the sqlite3 database is accessible299to anything that needs it for the duration of the request.300301If the :data:`~flask._app_ctx_stack` does not exist because the user uses302an old version of Flask, it is recommended to fall back to303:data:`~flask._request_ctx_stack` which is bound to a request.304305Teardown Behavior306-----------------307308*This is only relevant if you want to support Flask 0.6 and older*309Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 310–323why, one step back310Due to the change in Flask 0.7 regarding functions that are run at the end311of the request your extension will have to be extra careful there if it312wants to continue to support older versions of Flask. The following313pattern is a good way to support both::314315 def close_connection(response):316 ctx = _request_ctx_stack.top317 ctx.sqlite3_db.close()318 return response319320 if hasattr(app, 'teardown_request'):321 app.teardown_request(close_connection)322 else:323 app.after_request(close_connection)Merge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption3249eeb
line 324why, one step back324Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 325–358why, one step back325Strictly speaking the above code is wrong, because teardown functions are326passed the exception and typically don't return anything. However because327the return value is discarded this will just work assuming that the code328in between does not touch the passed parameter.329330Learn from Others331-----------------332333This documentation only touches the bare minimum for extension334development. If you want to learn more, it's a very good idea to check335out existing extensions on the `Flask Extension Registry`_. If you feel336lost there is still the `mailinglist`_ and the `IRC channel`_ to get some337ideas for nice looking APIs. Especially if you do something nobody before338you did, it might be a very good idea to get some more input. This not339only to get an idea about what people might want to have from an340extension, but also to avoid having multiple developers working on pretty341much the same side by side.342343Remember: good API design is hard, so introduce your project on the344mailinglist, and let other developers give you a helping hand with345designing the API.346347The best Flask extensions are extensions that share common idioms for the348API. And this can only work if collaboration happens early.349350Approved Extensions351-------------------352353Flask also has the concept of approved extensions. Approved extensions354are tested as part of Flask itself to ensure extensions do not break on355new releases. These approved extensions are listed on the `Flask356Extension Registry`_ and marked appropriately. If you want your own357extension to be approved you have to follow these guidelines:358Merge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption3249eeb
lines 359–362why, one step back3590. An approved Flask extension requires a maintainer. In the event an360 extension author would like to move beyond the project, the project should361 find a new maintainer including full source hosting transition and PyPI362 access. If no maintainer is available, give access to the Flask core team.Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
line 363why, one step back3631. An approved Flask extension must provide exactly one package or moduleDocumented new import system for extensionsArmin Ronacherbefore adoption0719ad5
lines 364–365why, one step back364 named ``flask_extensionname``. They might also reside inside a365 ``flaskext`` namespace packages though this is discouraged now.Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 366–368why, one step back3662. It must ship a testing suite that can either be invoked with ``make test``367 or ``python setup.py test``. For test suites invoked with ``make368 test`` the extension has to ensure that all dependencies for the testMerge branch 'master' of github.com:mitsuhiko/flaskArmin Ronacherbefore adoption3249eeb
lines 369–371why, one step back369 are installed automatically. If tests are invoked with ``python setup.py370 test``, test dependencies can be specified in the `setup.py` file. The371 test suite also has to be part of the distribution.Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 372–397why, one step back3723. APIs of approved extensions will be checked for the following373 characteristics:374375 - an approved extension has to support multiple applications376 running in the same Python process.377 - it must be possible to use the factory pattern for creating378 applications.3793804. The license must be BSD/MIT/WTFPL licensed.3815. The naming scheme for official extensions is *Flask-ExtensionName* or382 *ExtensionName-Flask*.3836. Approved extensions must define all their dependencies in the384 `setup.py` file unless a dependency cannot be met because it is not385 available on PyPI.3867. The extension must have documentation that uses one of the two Flask387 themes for Sphinx documentation.3888. The setup.py description (and thus the PyPI description) has to389 link to the documentation, website (if there is one) and there390 must be a link to automatically install the development version391 (``PackageName==dev``).3929. The ``zip_safe`` flag in the setup script must be set to ``False``,393 even if the extension would be safe for zipping.39410. An extension currently has to support Python 2.5, 2.6 as well as395 Python 2.7396397Documented new import system for extensionsArmin Ronacherbefore adoption0719ad5
lines 398–418why, one step back398.. _ext-import-transition:399400Extension Import Transition401---------------------------402403For a while we recommended using namespace packages for Flask extensions.404This turned out to be problematic in practice because many different405competing namespace package systems exist and pip would automatically406switch between different systems and this caused a lot of problems for407users.408409Instead we now recommend naming packages ``flask_foo`` instead of the now410deprecated ``flaskext.foo``. Flask 0.8 introduces a redirect import411system that lets uses import from ``flask.ext.foo`` and it will try412``flask_foo`` first and if that fails ``flaskext.foo``.413414Flask extensions should urge users to import from ``flask.ext.foo``415instead of ``flask_foo`` or ``flaskext_foo`` so that extensions can416transition to the new package name without affecting users.417418Fixed a bug in the testsuite that caused problems when dots where in directory namesArmin Ronacherbefore adoptionfbd6776
lines 419–421why, one step back419.. _OAuth extension: http://packages.python.org/Flask-OAuth/420.. _mailinglist: http://flask.pocoo.org/mailinglist/421.. _IRC channel: http://flask.pocoo.org/community/irc/