Skip to content
Myr

add rst extension for changelog

Before adoption: this commit came in with the history the project adopted, so no landing records it.

fix changelog version

authored by David Lord · committed by David Lord · parent e21abd9 · Browse files · 4 files+788 added−791 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+788 added−791 removed

  • other:+788 added−791 removed

4 files+788 added−791 removed

modified:docs/changelog.rst+1 added-1 removed
1.. include:: ../CHANGES1.. include:: ../CHANGES.rst
modified:scripts/make-release.py+1 added-1 removed
19 unmodified lines
20_date_clean_re = re.compile(r'(\d+)(st|nd|rd|th)')212223def parse_changelog():24 with open('CHANGES') as f:24 with open('CHANGES.rst') as f:25 lineiter = iter(f)26 for line in lineiter:27 match = re.search('^Version\s+(.*)', line.strip())28 if match is None:
118 unmodified lines
deleted:CHANGES-789 removed
1Flask Changelog2===============34Here you can see the full list of changes between each Flask release.567Version 0.138------------910Major release, unreleased1112- **Python 2.6 and 3.3 are no longer supported.** (`pallets/meta#24`_)13- Minimum Werkzeug version bumped to 0.9, but please use the latest version.14- Minimum Click version bumped to 4, but please use the latest version.15- Make ``app.run()`` into a noop if a Flask application is run from the16 development server on the command line. This avoids some behavior that17 was confusing to debug for newcomers.18- Change default configuration ``JSONIFY_PRETTYPRINT_REGULAR=False``.19 ``jsonify()`` method returns compressed response by default, and pretty20 response in debug mode. (`#2193`_)21- Change ``Flask.__init__`` to accept two new keyword arguments,22 ``host_matching`` and ``static_host``. This enables ``host_matching`` to be23 set properly by the time the constructor adds the static route, and enables24 the static route to be properly associated with the required host.25 (``#1559``)26- ``send_file`` supports Unicode in ``attachment_filename``. (`#2223`_)27- Pass ``_scheme`` argument from ``url_for`` to ``handle_build_error``.28 (`#2017`_)29- Add support for ``provide_automatic_options`` in ``add_url_rule`` to disable30 adding OPTIONS method when the ``view_func`` argument is not a class.31 (`#1489`_).32- ``MethodView`` can inherit method handlers from base classes. (`#1936`_)33- Errors caused while opening the session at the beginning of the request are34 handled by the app's error handlers. (`#2254`_)35- Blueprints gained ``json_encoder`` and ``json_decoder`` attributes to36 override the app's encoder and decoder. (`#1898`_)37- ``Flask.make_response`` raises ``TypeError`` instead of ``ValueError`` for38 bad response types. The error messages have been improved to describe why the39 type is invalid. (`#2256`_)40- Add ``routes`` CLI command to output routes registered on the application.41 (`#2259`_)42- Show warning when session cookie domain is a bare hostname or an IP43 address, as these may not behave properly in some browsers, such as Chrome.44 (`#2282`_)45- Allow IP address as exact session cookie domain. (`#2282`_)46- ``SESSION_COOKIE_DOMAIN`` is set if it is detected through ``SERVER_NAME``.47 (`#2282`_)48- Auto-detect zero-argument app factory called ``create_app`` or ``make_app``49 from ``FLASK_APP``. (`#2297`_)50- Factory functions are not required to take a ``script_info`` parameter to51 work with the ``flask`` command. If they take a single parameter or a52 parameter named ``script_info``, the ``ScriptInfo`` object will be passed.53 (`#2319`_)54- FLASK_APP=myproject.app:create_app('dev') support.55- ``FLASK_APP`` can be set to an app factory, with arguments if needed, for56 example ``FLASK_APP=myproject.app:create_app('dev')``. (`#2326`_)57- ``FLASK_APP`` can point to local packages that are not installed in dev mode,58 although `pip install -e` should still be preferred. (`#2414`_)59- ``View.provide_automatic_options = True`` is set on the view function from60 ``View.as_view``, to be detected in ``app.add_url_rule``. (`#2316`_)61- Error handling will try handlers registered for ``blueprint, code``,62 ``app, code``, ``blueprint, exception``, ``app, exception``. (`#2314`_)63- ``Cookie`` is added to the response's ``Vary`` header if the session is64 accessed at all during the request (and it wasn't deleted). (`#2288`_)65- ``app.test_request_context()`` take ``subdomain`` and ``url_scheme``66 parameters for use when building base URL. (`#1621`_)67- Set ``APPLICATION_ROOT = '/'`` by default. This was already the implicit68 default when it was set to ``None``.69- ``TRAP_BAD_REQUEST_ERRORS`` is enabled by default in debug mode.70 ``BadRequestKeyError`` has a message with the bad key in debug mode instead71 of the generic bad request message. (`#2348`_)72- Allow registering new tags with ``TaggedJSONSerializer`` to support73 storing other types in the session cookie. (`#2352`_)74- Only open the session if the request has not been pushed onto the context75 stack yet. This allows ``stream_with_context`` generators to access the same76 session that the containing view uses. (`#2354`_)77- Add ``json`` keyword argument for the test client request methods. This will78 dump the given object as JSON and set the appropriate content type.79 (`#2358`_)80- Extract JSON handling to a mixin applied to both the request and response81 classes used by Flask. This adds the ``is_json`` and ``get_json`` methods to82 the response to make testing JSON response much easier. (`#2358`_)83- Removed error handler caching because it caused unexpected results for some84 exception inheritance hierarchies. Register handlers explicitly for each85 exception if you don't want to traverse the MRO. (`#2362`_)86- Fix incorrect JSON encoding of aware, non-UTC datetimes. (`#2374`_)87- Template auto reloading will honor the ``run`` command's ``debug`` flag even88 if ``app.jinja_env`` was already accessed. (`#2373`_)89- The following old deprecated code was removed. (`#2385`_)9091 - ``flask.ext`` - import extensions directly by their name instead of92 through the ``flask.ext`` namespace. For example,93 ``import flask.ext.sqlalchemy`` becomes ``import flask_sqlalchemy``.94 - ``Flask.init_jinja_globals`` - extend ``Flask.create_jinja_environment``95 instead.96 - ``Flask.error_handlers`` - tracked by ``Flask.error_handler_spec``,97 use ``@app.errorhandler`` to register handlers.98 - ``Flask.request_globals_class`` - use ``Flask.app_ctx_globals_class``99 instead.100 - ``Flask.static_path`` - use ``Flask.static_url_path`` instead.101 - ``Request.module`` - use ``Request.blueprint`` instead.102103- The ``request.json`` property is no longer deprecated. (`#1421`_)104- Support passing an existing ``EnvironBuilder`` or ``dict`` to105 ``test_client.open``. (`#2412`_)106- The ``flask`` command and ``app.run`` will load environment variables using107 from ``.env`` and ``.flaskenv`` files if python-dotenv is installed.108 (`#2416`_)109- When passing a full URL to the test client, use the scheme in the URL instead110 of the ``PREFERRED_URL_SCHEME``. (`#2430`_)111- ``app.logger`` has been simplified. ``LOGGER_NAME`` and112 ``LOGGER_HANDLER_POLICY`` config was removed. The logger is always named113 ``flask.app``. The level is only set on first access, it doesn't check114 ``app.debug`` each time. Only one format is used, not different ones115 depending on ``app.debug``. No handlers are removed, and a handler is only116 added if no handlers are already configured. (`#2436`_)117- Blueprint view function name may not contain dots. (`#2450`_)118- The dev server now uses threads by default. (`#2529`_)119- Loading config files with ``silent=True`` will ignore ``ENOTDIR``120 errors. (`#2581`_)121- Pass ``--cert`` and ``--key`` options to ``flask run`` to run the122 development server over HTTPS. (`#2606`_)123124.. _pallets/meta#24: https://github.com/pallets/meta/issues/24125.. _#1421: https://github.com/pallets/flask/issues/1421126.. _#1489: https://github.com/pallets/flask/pull/1489127.. _#1621: https://github.com/pallets/flask/pull/1621128.. _#1898: https://github.com/pallets/flask/pull/1898129.. _#1936: https://github.com/pallets/flask/pull/1936130.. _#2017: https://github.com/pallets/flask/pull/2017131.. _#2193: https://github.com/pallets/flask/pull/2193132.. _#2223: https://github.com/pallets/flask/pull/2223133.. _#2254: https://github.com/pallets/flask/pull/2254134.. _#2256: https://github.com/pallets/flask/pull/2256135.. _#2259: https://github.com/pallets/flask/pull/2259136.. _#2282: https://github.com/pallets/flask/pull/2282137.. _#2288: https://github.com/pallets/flask/pull/2288138.. _#2297: https://github.com/pallets/flask/pull/2297139.. _#2314: https://github.com/pallets/flask/pull/2314140.. _#2316: https://github.com/pallets/flask/pull/2316141.. _#2319: https://github.com/pallets/flask/pull/2319142.. _#2326: https://github.com/pallets/flask/pull/2326143.. _#2348: https://github.com/pallets/flask/pull/2348144.. _#2352: https://github.com/pallets/flask/pull/2352145.. _#2354: https://github.com/pallets/flask/pull/2354146.. _#2358: https://github.com/pallets/flask/pull/2358147.. _#2362: https://github.com/pallets/flask/pull/2362148.. _#2374: https://github.com/pallets/flask/pull/2374149.. _#2373: https://github.com/pallets/flask/pull/2373150.. _#2385: https://github.com/pallets/flask/issues/2385151.. _#2412: https://github.com/pallets/flask/pull/2412152.. _#2414: https://github.com/pallets/flask/pull/2414153.. _#2416: https://github.com/pallets/flask/pull/2416154.. _#2430: https://github.com/pallets/flask/pull/2430155.. _#2436: https://github.com/pallets/flask/pull/2436156.. _#2450: https://github.com/pallets/flask/pull/2450157.. _#2529: https://github.com/pallets/flask/pull/2529158.. _#2581: https://github.com/pallets/flask/pull/2581159.. _#2606: https://github.com/pallets/flask/pull/2606160161162Version 0.12.3163--------------164165Bugfix release, unreleased166167- Fix a ValueError caused by invalid Range requests in some cases168169170Version 0.12.2171--------------172173Released on May 16 2017174175- Fix a bug in `safe_join` on Windows.176177Version 0.12.1178--------------179180Bugfix release, released on March 31st 2017181182- Prevent `flask run` from showing a NoAppException when an ImportError occurs183 within the imported application module.184- Fix encoding behavior of ``app.config.from_pyfile`` for Python 3. Fix185 ``#2118``.186- Use the ``SERVER_NAME`` config if it is present as default values for187 ``app.run``. ``#2109``, ``#2152``188- Call `ctx.auto_pop` with the exception object instead of `None`, in the189 event that a `BaseException` such as `KeyboardInterrupt` is raised in a190 request handler.191192Version 0.12193------------194195Released on December 21st 2016, codename Punsch.196197- the cli command now responds to `--version`.198- Mimetype guessing and ETag generation for file-like objects in ``send_file``199 has been removed, as per issue ``#104``. See pull request ``#1849``.200- Mimetype guessing in ``send_file`` now fails loudly and doesn't fall back to201 ``application/octet-stream``. See pull request ``#1988``.202- Make ``flask.safe_join`` able to join multiple paths like ``os.path.join``203 (pull request ``#1730``).204- Revert a behavior change that made the dev server crash instead of returning205 a Internal Server Error (pull request ``#2006``).206- Correctly invoke response handlers for both regular request dispatching as207 well as error handlers.208- Disable logger propagation by default for the app logger.209- Add support for range requests in ``send_file``.210- ``app.test_client`` includes preset default environment, which can now be211 directly set, instead of per ``client.get``.212213Version 0.11.2214--------------215216Bugfix release, unreleased217218- Fix crash when running under PyPy3, see pull request ``#1814``.219220Version 0.11.1221--------------222223Bugfix release, released on June 7th 2016.224225- Fixed a bug that prevented ``FLASK_APP=foobar/__init__.py`` from working. See226 pull request ``#1872``.227228Version 0.11229------------230231Released on May 29th 2016, codename Absinthe.232233- Added support to serializing top-level arrays to :func:`flask.jsonify`. This234 introduces a security risk in ancient browsers. See235 :ref:`json-security` for details.236- Added before_render_template signal.237- Added `**kwargs` to :meth:`flask.Test.test_client` to support passing238 additional keyword arguments to the constructor of239 :attr:`flask.Flask.test_client_class`.240- Added ``SESSION_REFRESH_EACH_REQUEST`` config key that controls the241 set-cookie behavior. If set to ``True`` a permanent session will be242 refreshed each request and get their lifetime extended, if set to243 ``False`` it will only be modified if the session actually modifies.244 Non permanent sessions are not affected by this and will always245 expire if the browser window closes.246- Made Flask support custom JSON mimetypes for incoming data.247- Added support for returning tuples in the form ``(response, headers)``248 from a view function.249- Added :meth:`flask.Config.from_json`.250- Added :attr:`flask.Flask.config_class`.251- Added :meth:`flask.Config.get_namespace`.252- Templates are no longer automatically reloaded outside of debug mode. This253 can be configured with the new ``TEMPLATES_AUTO_RELOAD`` config key.254- Added a workaround for a limitation in Python 3.3's namespace loader.255- Added support for explicit root paths when using Python 3.3's namespace256 packages.257- Added :command:`flask` and the ``flask.cli`` module to start the local258 debug server through the click CLI system. This is recommended over the old259 ``flask.run()`` method as it works faster and more reliable due to a260 different design and also replaces ``Flask-Script``.261- Error handlers that match specific classes are now checked first,262 thereby allowing catching exceptions that are subclasses of HTTP263 exceptions (in ``werkzeug.exceptions``). This makes it possible264 for an extension author to create exceptions that will by default265 result in the HTTP error of their choosing, but may be caught with266 a custom error handler if desired.267- Added :meth:`flask.Config.from_mapping`.268- Flask will now log by default even if debug is disabled. The log format is269 now hardcoded but the default log handling can be disabled through the270 ``LOGGER_HANDLER_POLICY`` configuration key.271- Removed deprecated module functionality.272- Added the ``EXPLAIN_TEMPLATE_LOADING`` config flag which when enabled will273 instruct Flask to explain how it locates templates. This should help274 users debug when the wrong templates are loaded.275- Enforce blueprint handling in the order they were registered for template276 loading.277- Ported test suite to py.test.278- Deprecated ``request.json`` in favour of ``request.get_json()``.279- Add "pretty" and "compressed" separators definitions in jsonify() method.280 Reduces JSON response size when JSONIFY_PRETTYPRINT_REGULAR=False by removing281 unnecessary white space included by default after separators.282- JSON responses are now terminated with a newline character, because it is a283 convention that UNIX text files end with a newline and some clients don't284 deal well when this newline is missing. See285 https://github.com/pallets/flask/pull/1262 -- this came up originally as a286 part of https://github.com/kennethreitz/httpbin/issues/168287- The automatically provided ``OPTIONS`` method is now correctly disabled if288 the user registered an overriding rule with the lowercase-version289 ``options`` (issue ``#1288``).290- ``flask.json.jsonify`` now supports the ``datetime.date`` type (pull request291 ``#1326``).292- Don't leak exception info of already catched exceptions to context teardown293 handlers (pull request ``#1393``).294- Allow custom Jinja environment subclasses (pull request ``#1422``).295- Updated extension dev guidelines.296297- ``flask.g`` now has ``pop()`` and ``setdefault`` methods.298- Turn on autoescape for ``flask.templating.render_template_string`` by default299 (pull request ``#1515``).300- ``flask.ext`` is now deprecated (pull request ``#1484``).301- ``send_from_directory`` now raises BadRequest if the filename is invalid on302 the server OS (pull request ``#1763``).303- Added the ``JSONIFY_MIMETYPE`` configuration variable (pull request ``#1728``).304- Exceptions during teardown handling will no longer leave bad application305 contexts lingering around.306307Version 0.10.2308--------------309310(bugfix release, release date to be announced)311312- Fixed broken `test_appcontext_signals()` test case.313- Raise an :exc:`AttributeError` in :func:`flask.helpers.find_package` with a314 useful message explaining why it is raised when a PEP 302 import hook is used315 without an `is_package()` method.316- Fixed an issue causing exceptions raised before entering a request or app317 context to be passed to teardown handlers.318- Fixed an issue with query parameters getting removed from requests in319 the test client when absolute URLs were requested.320- Made `@before_first_request` into a decorator as intended.321- Fixed an etags bug when sending a file streams with a name.322- Fixed `send_from_directory` not expanding to the application root path323 correctly.324- Changed logic of before first request handlers to flip the flag after325 invoking. This will allow some uses that are potentially dangerous but326 should probably be permitted.327- Fixed Python 3 bug when a handler from `app.url_build_error_handlers`328 reraises the `BuildError`.329330Version 0.10.1331--------------332333(bugfix release, released on June 14th 2013)334335- Fixed an issue where ``|tojson`` was not quoting single quotes which336 made the filter not work properly in HTML attributes. Now it's337 possible to use that filter in single quoted attributes. This should338 make using that filter with angular.js easier.339- Added support for byte strings back to the session system. This broke340 compatibility with the common case of people putting binary data for341 token verification into the session.342- Fixed an issue where registering the same method twice for the same endpoint343 would trigger an exception incorrectly.344345Version 0.10346------------347348Released on June 13th 2013, codename Limoncello.349350- Changed default cookie serialization format from pickle to JSON to351 limit the impact an attacker can do if the secret key leaks. See352 :ref:`upgrading-to-010` for more information.353- Added ``template_test`` methods in addition to the already existing354 ``template_filter`` method family.355- Added ``template_global`` methods in addition to the already existing356 ``template_filter`` method family.357- Set the content-length header for x-sendfile.358- ``tojson`` filter now does not escape script blocks in HTML5 parsers.359- ``tojson`` used in templates is now safe by default due. This was360 allowed due to the different escaping behavior.361- Flask will now raise an error if you attempt to register a new function362 on an already used endpoint.363- Added wrapper module around simplejson and added default serialization364 of datetime objects. This allows much easier customization of how365 JSON is handled by Flask or any Flask extension.366- Removed deprecated internal ``flask.session`` module alias. Use367 ``flask.sessions`` instead to get the session module. This is not to368 be confused with ``flask.session`` the session proxy.369- Templates can now be rendered without request context. The behavior is370 slightly different as the ``request``, ``session`` and ``g`` objects371 will not be available and blueprint's context processors are not372 called.373- The config object is now available to the template as a real global and374 not through a context processor which makes it available even in imported375 templates by default.376- Added an option to generate non-ascii encoded JSON which should result377 in less bytes being transmitted over the network. It's disabled by378 default to not cause confusion with existing libraries that might expect379 ``flask.json.dumps`` to return bytestrings by default.380- ``flask.g`` is now stored on the app context instead of the request381 context.382- ``flask.g`` now gained a ``get()`` method for not erroring out on non383 existing items.384- ``flask.g`` now can be used with the ``in`` operator to see what's defined385 and it now is iterable and will yield all attributes stored.386- ``flask.Flask.request_globals_class`` got renamed to387 ``flask.Flask.app_ctx_globals_class`` which is a better name to what it388 does since 0.10.389- `request`, `session` and `g` are now also added as proxies to the template390 context which makes them available in imported templates. One has to be391 very careful with those though because usage outside of macros might392 cause caching.393- Flask will no longer invoke the wrong error handlers if a proxy394 exception is passed through.395- Added a workaround for chrome's cookies in localhost not working396 as intended with domain names.397- Changed logic for picking defaults for cookie values from sessions398 to work better with Google Chrome.399- Added `message_flashed` signal that simplifies flashing testing.400- Added support for copying of request contexts for better working with401 greenlets.402- Removed custom JSON HTTP exception subclasses. If you were relying on them403 you can reintroduce them again yourself trivially. Using them however is404 strongly discouraged as the interface was flawed.405- Python requirements changed: requiring Python 2.6 or 2.7 now to prepare406 for Python 3.3 port.407- Changed how the teardown system is informed about exceptions. This is now408 more reliable in case something handles an exception halfway through409 the error handling process.410- Request context preservation in debug mode now keeps the exception411 information around which means that teardown handlers are able to412 distinguish error from success cases.413- Added the ``JSONIFY_PRETTYPRINT_REGULAR`` configuration variable.414- Flask now orders JSON keys by default to not trash HTTP caches due to415 different hash seeds between different workers.416- Added `appcontext_pushed` and `appcontext_popped` signals.417- The builtin run method now takes the ``SERVER_NAME`` into account when418 picking the default port to run on.419- Added `flask.request.get_json()` as a replacement for the old420 `flask.request.json` property.421422Version 0.9423-----------424425Released on July 1st 2012, codename Campari.426427- The :func:`flask.Request.on_json_loading_failed` now returns a JSON formatted428 response by default.429- The :func:`flask.url_for` function now can generate anchors to the430 generated links.431- The :func:`flask.url_for` function now can also explicitly generate432 URL rules specific to a given HTTP method.433- Logger now only returns the debug log setting if it was not set434 explicitly.435- Unregister a circular dependency between the WSGI environment and436 the request object when shutting down the request. This means that437 environ ``werkzeug.request`` will be ``None`` after the response was438 returned to the WSGI server but has the advantage that the garbage439 collector is not needed on CPython to tear down the request unless440 the user created circular dependencies themselves.441- Session is now stored after callbacks so that if the session payload442 is stored in the session you can still modify it in an after443 request callback.444- The :class:`flask.Flask` class will avoid importing the provided import name445 if it can (the required first parameter), to benefit tools which build Flask446 instances programmatically. The Flask class will fall back to using import447 on systems with custom module hooks, e.g. Google App Engine, or when the448 import name is inside a zip archive (usually a .egg) prior to Python 2.7.449- Blueprints now have a decorator to add custom template filters application450 wide, :meth:`flask.Blueprint.app_template_filter`.451- The Flask and Blueprint classes now have a non-decorator method for adding452 custom template filters application wide,453 :meth:`flask.Flask.add_template_filter` and454 :meth:`flask.Blueprint.add_app_template_filter`.455- The :func:`flask.get_flashed_messages` function now allows rendering flashed456 message categories in separate blocks, through a ``category_filter``457 argument.458- The :meth:`flask.Flask.run` method now accepts ``None`` for `host` and `port`459 arguments, using default values when ``None``. This allows for calling run460 using configuration values, e.g. ``app.run(app.config.get('MYHOST'),461 app.config.get('MYPORT'))``, with proper behavior whether or not a config462 file is provided.463- The :meth:`flask.render_template` method now accepts a either an iterable of464 template names or a single template name. Previously, it only accepted a465 single template name. On an iterable, the first template found is rendered.466- Added :meth:`flask.Flask.app_context` which works very similar to the467 request context but only provides access to the current application. This468 also adds support for URL generation without an active request context.469- View functions can now return a tuple with the first instance being an470 instance of :class:`flask.Response`. This allows for returning471 ``jsonify(error="error msg"), 400`` from a view function.472- :class:`~flask.Flask` and :class:`~flask.Blueprint` now provide a473 :meth:`~flask.Flask.get_send_file_max_age` hook for subclasses to override474 behavior of serving static files from Flask when using475 :meth:`flask.Flask.send_static_file` (used for the default static file476 handler) and :func:`~flask.helpers.send_file`. This hook is provided a477 filename, which for example allows changing cache controls by file extension.478 The default max-age for `send_file` and static files can be configured479 through a new ``SEND_FILE_MAX_AGE_DEFAULT`` configuration variable, which is480 used in the default `get_send_file_max_age` implementation.481- Fixed an assumption in sessions implementation which could break message482 flashing on sessions implementations which use external storage.483- Changed the behavior of tuple return values from functions. They are no484 longer arguments to the response object, they now have a defined meaning.485- Added :attr:`flask.Flask.request_globals_class` to allow a specific class to486 be used on creation of the :data:`~flask.g` instance of each request.487- Added `required_methods` attribute to view functions to force-add methods488 on registration.489- Added :func:`flask.after_this_request`.490- Added :func:`flask.stream_with_context` and the ability to push contexts491 multiple times without producing unexpected behavior.492493Version 0.8.1494-------------495496Bugfix release, released on July 1st 2012497498- Fixed an issue with the undocumented `flask.session` module to not499 work properly on Python 2.5. It should not be used but did cause500 some problems for package managers.501502Version 0.8503-----------504505Released on September 29th 2011, codename Rakija506507- Refactored session support into a session interface so that508 the implementation of the sessions can be changed without509 having to override the Flask class.510- Empty session cookies are now deleted properly automatically.511- View functions can now opt out of getting the automatic512 OPTIONS implementation.513- HTTP exceptions and Bad Request errors can now be trapped so that they514 show up normally in the traceback.515- Flask in debug mode is now detecting some common problems and tries to516 warn you about them.517- Flask in debug mode will now complain with an assertion error if a view518 was attached after the first request was handled. This gives earlier519 feedback when users forget to import view code ahead of time.520- Added the ability to register callbacks that are only triggered once at521 the beginning of the first request. (:meth:`Flask.before_first_request`)522- Malformed JSON data will now trigger a bad request HTTP exception instead523 of a value error which usually would result in a 500 internal server524 error if not handled. This is a backwards incompatible change.525- Applications now not only have a root path where the resources and modules526 are located but also an instance path which is the designated place to527 drop files that are modified at runtime (uploads etc.). Also this is528 conceptually only instance depending and outside version control so it's529 the perfect place to put configuration files etc. For more information530 see :ref:`instance-folders`.531- Added the ``APPLICATION_ROOT`` configuration variable.532- Implemented :meth:`~flask.testing.TestClient.session_transaction` to533 easily modify sessions from the test environment.534- Refactored test client internally. The ``APPLICATION_ROOT`` configuration535 variable as well as ``SERVER_NAME`` are now properly used by the test client536 as defaults.537- Added :attr:`flask.views.View.decorators` to support simpler decorating of538 pluggable (class-based) views.539- Fixed an issue where the test client if used with the "with" statement did not540 trigger the execution of the teardown handlers.541- Added finer control over the session cookie parameters.542- HEAD requests to a method view now automatically dispatch to the `get`543 method if no handler was implemented.544- Implemented the virtual :mod:`flask.ext` package to import extensions from.545- The context preservation on exceptions is now an integral component of546 Flask itself and no longer of the test client. This cleaned up some547 internal logic and lowers the odds of runaway request contexts in unittests.548549Version 0.7.3550-------------551552Bugfix release, release date to be decided553554- Fixed the Jinja2 environment's list_templates method not returning the555 correct names when blueprints or modules were involved.556557Version 0.7.2558-------------559560Bugfix release, released on July 6th 2011561562- Fixed an issue with URL processors not properly working on563 blueprints.564565Version 0.7.1566-------------567568Bugfix release, released on June 29th 2011569570- Added missing future import that broke 2.5 compatibility.571- Fixed an infinite redirect issue with blueprints.572573Version 0.7574-----------575576Released on June 28th 2011, codename Grappa577578- Added :meth:`~flask.Flask.make_default_options_response`579 which can be used by subclasses to alter the default580 behavior for ``OPTIONS`` responses.581- Unbound locals now raise a proper :exc:`RuntimeError` instead582 of an :exc:`AttributeError`.583- Mimetype guessing and etag support based on file objects is now584 deprecated for :func:`flask.send_file` because it was unreliable.585 Pass filenames instead or attach your own etags and provide a586 proper mimetype by hand.587- Static file handling for modules now requires the name of the588 static folder to be supplied explicitly. The previous autodetection589 was not reliable and caused issues on Google's App Engine. Until590 1.0 the old behavior will continue to work but issue dependency591 warnings.592- fixed a problem for Flask to run on jython.593- added a ``PROPAGATE_EXCEPTIONS`` configuration variable that can be594 used to flip the setting of exception propagation which previously595 was linked to ``DEBUG`` alone and is now linked to either ``DEBUG`` or596 ``TESTING``.597- Flask no longer internally depends on rules being added through the598 `add_url_rule` function and can now also accept regular werkzeug599 rules added to the url map.600- Added an `endpoint` method to the flask application object which601 allows one to register a callback to an arbitrary endpoint with602 a decorator.603- Use Last-Modified for static file sending instead of Date which604 was incorrectly introduced in 0.6.605- Added `create_jinja_loader` to override the loader creation process.606- Implemented a silent flag for `config.from_pyfile`.607- Added `teardown_request` decorator, for functions that should run at the end608 of a request regardless of whether an exception occurred. Also the behavior609 for `after_request` was changed. It's now no longer executed when an exception610 is raised. See :ref:`upgrading-to-new-teardown-handling`611- Implemented :func:`flask.has_request_context`612- Deprecated `init_jinja_globals`. Override the613 :meth:`~flask.Flask.create_jinja_environment` method instead to614 achieve the same functionality.615- Added :func:`flask.safe_join`616- The automatic JSON request data unpacking now looks at the charset617 mimetype parameter.618- Don't modify the session on :func:`flask.get_flashed_messages` if there619 are no messages in the session.620- `before_request` handlers are now able to abort requests with errors.621- it is not possible to define user exception handlers. That way you can622 provide custom error messages from a central hub for certain errors that623 might occur during request processing (for instance database connection624 errors, timeouts from remote resources etc.).625- Blueprints can provide blueprint specific error handlers.626- Implemented generic :ref:`views` (class-based views).627628Version 0.6.1629-------------630631Bugfix release, released on December 31st 2010632633- Fixed an issue where the default ``OPTIONS`` response was634 not exposing all valid methods in the ``Allow`` header.635- Jinja2 template loading syntax now allows "./" in front of636 a template load path. Previously this caused issues with637 module setups.638- Fixed an issue where the subdomain setting for modules was639 ignored for the static folder.640- Fixed a security problem that allowed clients to download arbitrary files641 if the host server was a windows based operating system and the client642 uses backslashes to escape the directory the files where exposed from.643644Version 0.6645-----------646647Released on July 27th 2010, codename Whisky648649- after request functions are now called in reverse order of650 registration.651- OPTIONS is now automatically implemented by Flask unless the652 application explicitly adds 'OPTIONS' as method to the URL rule.653 In this case no automatic OPTIONS handling kicks in.654- static rules are now even in place if there is no static folder655 for the module. This was implemented to aid GAE which will656 remove the static folder if it's part of a mapping in the .yml657 file.658- the :attr:`~flask.Flask.config` is now available in the templates659 as `config`.660- context processors will no longer override values passed directly661 to the render function.662- added the ability to limit the incoming request data with the663 new ``MAX_CONTENT_LENGTH`` configuration value.664- the endpoint for the :meth:`flask.Module.add_url_rule` method665 is now optional to be consistent with the function of the666 same name on the application object.667- added a :func:`flask.make_response` function that simplifies668 creating response object instances in views.669- added signalling support based on blinker. This feature is currently670 optional and supposed to be used by extensions and applications. If671 you want to use it, make sure to have `blinker`_ installed.672- refactored the way URL adapters are created. This process is now673 fully customizable with the :meth:`~flask.Flask.create_url_adapter`674 method.675- modules can now register for a subdomain instead of just an URL676 prefix. This makes it possible to bind a whole module to a677 configurable subdomain.678679.. _blinker: https://pypi.python.org/pypi/blinker680681Version 0.5.2682-------------683684Bugfix Release, released on July 15th 2010685686- fixed another issue with loading templates from directories when687 modules were used.688689Version 0.5.1690-------------691692Bugfix Release, released on July 6th 2010693694- fixes an issue with template loading from directories when modules695 where used.696697Version 0.5698-----------699700Released on July 6th 2010, codename Calvados701702- fixed a bug with subdomains that was caused by the inability to703 specify the server name. The server name can now be set with704 the ``SERVER_NAME`` config key. This key is now also used to set705 the session cookie cross-subdomain wide.706- autoescaping is no longer active for all templates. Instead it707 is only active for ``.html``, ``.htm``, ``.xml`` and ``.xhtml``.708 Inside templates this behavior can be changed with the709 ``autoescape`` tag.710- refactored Flask internally. It now consists of more than a711 single file.712- :func:`flask.send_file` now emits etags and has the ability to713 do conditional responses builtin.714- (temporarily) dropped support for zipped applications. This was a715 rarely used feature and led to some confusing behavior.716- added support for per-package template and static-file directories.717- removed support for `create_jinja_loader` which is no longer used718 in 0.5 due to the improved module support.719- added a helper function to expose files from any directory.720721Version 0.4722-----------723724Released on June 18th 2010, codename Rakia725726- added the ability to register application wide error handlers727 from modules.728- :meth:`~flask.Flask.after_request` handlers are now also invoked729 if the request dies with an exception and an error handling page730 kicks in.731- test client has not the ability to preserve the request context732 for a little longer. This can also be used to trigger custom733 requests that do not pop the request stack for testing.734- because the Python standard library caches loggers, the name of735 the logger is configurable now to better support unittests.736- added ``TESTING`` switch that can activate unittesting helpers.737- the logger switches to ``DEBUG`` mode now if debug is enabled.738739Version 0.3.1740-------------741742Bugfix release, released on May 28th 2010743744- fixed a error reporting bug with :meth:`flask.Config.from_envvar`745- removed some unused code from flask746- release does no longer include development leftover files (.git747 folder for themes, built documentation in zip and pdf file and748 some .pyc files)749750Version 0.3751-----------752753Released on May 28th 2010, codename Schnaps754755- added support for categories for flashed messages.756- the application now configures a :class:`logging.Handler` and will757 log request handling exceptions to that logger when not in debug758 mode. This makes it possible to receive mails on server errors759 for example.760- added support for context binding that does not require the use of761 the with statement for playing in the console.762- the request context is now available within the with statement making763 it possible to further push the request context or pop it.764- added support for configurations.765766Version 0.2767-----------768769Released on May 12th 2010, codename Jägermeister770771- various bugfixes772- integrated JSON support773- added :func:`~flask.get_template_attribute` helper function.774- :meth:`~flask.Flask.add_url_rule` can now also register a775 view function.776- refactored internal request dispatching.777- server listens on 127.0.0.1 by default now to fix issues with chrome.778- added external URL support.779- added support for :func:`~flask.send_file`780- module support and internal request handling refactoring781 to better support pluggable applications.782- sessions can be set to be permanent now on a per-session basis.783- better error reporting on missing secret keys.784- added support for Google Appengine.785786Version 0.1787-----------788789First public preview release.
added:CHANGES.rst+786 added
1Flask Changelog2===============345Version 1.06-----------78unreleased910- **Python 2.6 and 3.3 are no longer supported.** (`pallets/meta#24`_)11- Minimum Werkzeug version bumped to 0.14, but please use the latest12 version.13- Minimum Click version bumped to 4, but please use the latest version.14- Make ``app.run()`` into a noop if a Flask application is run from the15 development server on the command line. This avoids some behavior that16 was confusing to debug for newcomers.17- Change default configuration ``JSONIFY_PRETTYPRINT_REGULAR=False``.18 ``jsonify()`` method returns compressed response by default, and pretty19 response in debug mode. (`#2193`_)20- Change ``Flask.__init__`` to accept two new keyword arguments,21 ``host_matching`` and ``static_host``. This enables ``host_matching`` to be22 set properly by the time the constructor adds the static route, and enables23 the static route to be properly associated with the required host.24 (``#1559``)25- ``send_file`` supports Unicode in ``attachment_filename``. (`#2223`_)26- Pass ``_scheme`` argument from ``url_for`` to ``handle_build_error``.27 (`#2017`_)28- Add support for ``provide_automatic_options`` in ``add_url_rule`` to disable29 adding OPTIONS method when the ``view_func`` argument is not a class.30 (`#1489`_).31- ``MethodView`` can inherit method handlers from base classes. (`#1936`_)32- Errors caused while opening the session at the beginning of the request are33 handled by the app's error handlers. (`#2254`_)34- Blueprints gained ``json_encoder`` and ``json_decoder`` attributes to35 override the app's encoder and decoder. (`#1898`_)36- ``Flask.make_response`` raises ``TypeError`` instead of ``ValueError`` for37 bad response types. The error messages have been improved to describe why the38 type is invalid. (`#2256`_)39- Add ``routes`` CLI command to output routes registered on the application.40 (`#2259`_)41- Show warning when session cookie domain is a bare hostname or an IP42 address, as these may not behave properly in some browsers, such as Chrome.43 (`#2282`_)44- Allow IP address as exact session cookie domain. (`#2282`_)45- ``SESSION_COOKIE_DOMAIN`` is set if it is detected through ``SERVER_NAME``.46 (`#2282`_)47- Auto-detect zero-argument app factory called ``create_app`` or ``make_app``48 from ``FLASK_APP``. (`#2297`_)49- Factory functions are not required to take a ``script_info`` parameter to50 work with the ``flask`` command. If they take a single parameter or a51 parameter named ``script_info``, the ``ScriptInfo`` object will be passed.52 (`#2319`_)53- FLASK_APP=myproject.app:create_app('dev') support.54- ``FLASK_APP`` can be set to an app factory, with arguments if needed, for55 example ``FLASK_APP=myproject.app:create_app('dev')``. (`#2326`_)56- ``FLASK_APP`` can point to local packages that are not installed in dev mode,57 although `pip install -e` should still be preferred. (`#2414`_)58- ``View.provide_automatic_options = True`` is set on the view function from59 ``View.as_view``, to be detected in ``app.add_url_rule``. (`#2316`_)60- Error handling will try handlers registered for ``blueprint, code``,61 ``app, code``, ``blueprint, exception``, ``app, exception``. (`#2314`_)62- ``Cookie`` is added to the response's ``Vary`` header if the session is63 accessed at all during the request (and it wasn't deleted). (`#2288`_)64- ``app.test_request_context()`` take ``subdomain`` and ``url_scheme``65 parameters for use when building base URL. (`#1621`_)66- Set ``APPLICATION_ROOT = '/'`` by default. This was already the implicit67 default when it was set to ``None``.68- ``TRAP_BAD_REQUEST_ERRORS`` is enabled by default in debug mode.69 ``BadRequestKeyError`` has a message with the bad key in debug mode instead70 of the generic bad request message. (`#2348`_)71- Allow registering new tags with ``TaggedJSONSerializer`` to support72 storing other types in the session cookie. (`#2352`_)73- Only open the session if the request has not been pushed onto the context74 stack yet. This allows ``stream_with_context`` generators to access the same75 session that the containing view uses. (`#2354`_)76- Add ``json`` keyword argument for the test client request methods. This will77 dump the given object as JSON and set the appropriate content type.78 (`#2358`_)79- Extract JSON handling to a mixin applied to both the request and response80 classes used by Flask. This adds the ``is_json`` and ``get_json`` methods to81 the response to make testing JSON response much easier. (`#2358`_)82- Removed error handler caching because it caused unexpected results for some83 exception inheritance hierarchies. Register handlers explicitly for each84 exception if you don't want to traverse the MRO. (`#2362`_)85- Fix incorrect JSON encoding of aware, non-UTC datetimes. (`#2374`_)86- Template auto reloading will honor the ``run`` command's ``debug`` flag even87 if ``app.jinja_env`` was already accessed. (`#2373`_)88- The following old deprecated code was removed. (`#2385`_)8990 - ``flask.ext`` - import extensions directly by their name instead of91 through the ``flask.ext`` namespace. For example,92 ``import flask.ext.sqlalchemy`` becomes ``import flask_sqlalchemy``.93 - ``Flask.init_jinja_globals`` - extend ``Flask.create_jinja_environment``94 instead.95 - ``Flask.error_handlers`` - tracked by ``Flask.error_handler_spec``,96 use ``@app.errorhandler`` to register handlers.97 - ``Flask.request_globals_class`` - use ``Flask.app_ctx_globals_class``98 instead.99 - ``Flask.static_path`` - use ``Flask.static_url_path`` instead.100 - ``Request.module`` - use ``Request.blueprint`` instead.101102- The ``request.json`` property is no longer deprecated. (`#1421`_)103- Support passing an existing ``EnvironBuilder`` or ``dict`` to104 ``test_client.open``. (`#2412`_)105- The ``flask`` command and ``app.run`` will load environment variables using106 from ``.env`` and ``.flaskenv`` files if python-dotenv is installed.107 (`#2416`_)108- When passing a full URL to the test client, use the scheme in the URL instead109 of the ``PREFERRED_URL_SCHEME``. (`#2430`_)110- ``app.logger`` has been simplified. ``LOGGER_NAME`` and111 ``LOGGER_HANDLER_POLICY`` config was removed. The logger is always named112 ``flask.app``. The level is only set on first access, it doesn't check113 ``app.debug`` each time. Only one format is used, not different ones114 depending on ``app.debug``. No handlers are removed, and a handler is only115 added if no handlers are already configured. (`#2436`_)116- Blueprint view function name may not contain dots. (`#2450`_)117- Fix a ``ValueError`` caused by invalid Range requests in some cases.118 (`#2526`_)119- The dev server now uses threads by default. (`#2529`_)120- Loading config files with ``silent=True`` will ignore ``ENOTDIR``121 errors. (`#2581`_)122- Pass ``--cert`` and ``--key`` options to ``flask run`` to run the123 development server over HTTPS. (`#2606`_)124- Added :data:`SESSION_COOKIE_SAMESITE` to control the ``SameSite``125 attribute on the session cookie. (`#2607`_)126127.. _pallets/meta#24: https://github.com/pallets/meta/issues/24128.. _#1421: https://github.com/pallets/flask/issues/1421129.. _#1489: https://github.com/pallets/flask/pull/1489130.. _#1621: https://github.com/pallets/flask/pull/1621131.. _#1898: https://github.com/pallets/flask/pull/1898132.. _#1936: https://github.com/pallets/flask/pull/1936133.. _#2017: https://github.com/pallets/flask/pull/2017134.. _#2193: https://github.com/pallets/flask/pull/2193135.. _#2223: https://github.com/pallets/flask/pull/2223136.. _#2254: https://github.com/pallets/flask/pull/2254137.. _#2256: https://github.com/pallets/flask/pull/2256138.. _#2259: https://github.com/pallets/flask/pull/2259139.. _#2282: https://github.com/pallets/flask/pull/2282140.. _#2288: https://github.com/pallets/flask/pull/2288141.. _#2297: https://github.com/pallets/flask/pull/2297142.. _#2314: https://github.com/pallets/flask/pull/2314143.. _#2316: https://github.com/pallets/flask/pull/2316144.. _#2319: https://github.com/pallets/flask/pull/2319145.. _#2326: https://github.com/pallets/flask/pull/2326146.. _#2348: https://github.com/pallets/flask/pull/2348147.. _#2352: https://github.com/pallets/flask/pull/2352148.. _#2354: https://github.com/pallets/flask/pull/2354149.. _#2358: https://github.com/pallets/flask/pull/2358150.. _#2362: https://github.com/pallets/flask/pull/2362151.. _#2374: https://github.com/pallets/flask/pull/2374152.. _#2373: https://github.com/pallets/flask/pull/2373153.. _#2385: https://github.com/pallets/flask/issues/2385154.. _#2412: https://github.com/pallets/flask/pull/2412155.. _#2414: https://github.com/pallets/flask/pull/2414156.. _#2416: https://github.com/pallets/flask/pull/2416157.. _#2430: https://github.com/pallets/flask/pull/2430158.. _#2436: https://github.com/pallets/flask/pull/2436159.. _#2450: https://github.com/pallets/flask/pull/2450160.. _#2526: https://github.com/pallets/flask/issues/2526161.. _#2529: https://github.com/pallets/flask/pull/2529162.. _#2581: https://github.com/pallets/flask/pull/2581163.. _#2606: https://github.com/pallets/flask/pull/2606164.. _#2607: https://github.com/pallets/flask/pull/2607165166167Version 0.12.2168--------------169170Released on May 16 2017171172- Fix a bug in `safe_join` on Windows.173174Version 0.12.1175--------------176177Bugfix release, released on March 31st 2017178179- Prevent `flask run` from showing a NoAppException when an ImportError occurs180 within the imported application module.181- Fix encoding behavior of ``app.config.from_pyfile`` for Python 3. Fix182 ``#2118``.183- Use the ``SERVER_NAME`` config if it is present as default values for184 ``app.run``. ``#2109``, ``#2152``185- Call `ctx.auto_pop` with the exception object instead of `None`, in the186 event that a `BaseException` such as `KeyboardInterrupt` is raised in a187 request handler.188189Version 0.12190------------191192Released on December 21st 2016, codename Punsch.193194- the cli command now responds to `--version`.195- Mimetype guessing and ETag generation for file-like objects in ``send_file``196 has been removed, as per issue ``#104``. See pull request ``#1849``.197- Mimetype guessing in ``send_file`` now fails loudly and doesn't fall back to198 ``application/octet-stream``. See pull request ``#1988``.199- Make ``flask.safe_join`` able to join multiple paths like ``os.path.join``200 (pull request ``#1730``).201- Revert a behavior change that made the dev server crash instead of returning202 a Internal Server Error (pull request ``#2006``).203- Correctly invoke response handlers for both regular request dispatching as204 well as error handlers.205- Disable logger propagation by default for the app logger.206- Add support for range requests in ``send_file``.207- ``app.test_client`` includes preset default environment, which can now be208 directly set, instead of per ``client.get``.209210Version 0.11.2211--------------212213Bugfix release, unreleased214215- Fix crash when running under PyPy3, see pull request ``#1814``.216217Version 0.11.1218--------------219220Bugfix release, released on June 7th 2016.221222- Fixed a bug that prevented ``FLASK_APP=foobar/__init__.py`` from working. See223 pull request ``#1872``.224225Version 0.11226------------227228Released on May 29th 2016, codename Absinthe.229230- Added support to serializing top-level arrays to :func:`flask.jsonify`. This231 introduces a security risk in ancient browsers. See232 :ref:`json-security` for details.233- Added before_render_template signal.234- Added `**kwargs` to :meth:`flask.Test.test_client` to support passing235 additional keyword arguments to the constructor of236 :attr:`flask.Flask.test_client_class`.237- Added ``SESSION_REFRESH_EACH_REQUEST`` config key that controls the238 set-cookie behavior. If set to ``True`` a permanent session will be239 refreshed each request and get their lifetime extended, if set to240 ``False`` it will only be modified if the session actually modifies.241 Non permanent sessions are not affected by this and will always242 expire if the browser window closes.243- Made Flask support custom JSON mimetypes for incoming data.244- Added support for returning tuples in the form ``(response, headers)``245 from a view function.246- Added :meth:`flask.Config.from_json`.247- Added :attr:`flask.Flask.config_class`.248- Added :meth:`flask.Config.get_namespace`.249- Templates are no longer automatically reloaded outside of debug mode. This250 can be configured with the new ``TEMPLATES_AUTO_RELOAD`` config key.251- Added a workaround for a limitation in Python 3.3's namespace loader.252- Added support for explicit root paths when using Python 3.3's namespace253 packages.254- Added :command:`flask` and the ``flask.cli`` module to start the local255 debug server through the click CLI system. This is recommended over the old256 ``flask.run()`` method as it works faster and more reliable due to a257 different design and also replaces ``Flask-Script``.258- Error handlers that match specific classes are now checked first,259 thereby allowing catching exceptions that are subclasses of HTTP260 exceptions (in ``werkzeug.exceptions``). This makes it possible261 for an extension author to create exceptions that will by default262 result in the HTTP error of their choosing, but may be caught with263 a custom error handler if desired.264- Added :meth:`flask.Config.from_mapping`.265- Flask will now log by default even if debug is disabled. The log format is266 now hardcoded but the default log handling can be disabled through the267 ``LOGGER_HANDLER_POLICY`` configuration key.268- Removed deprecated module functionality.269- Added the ``EXPLAIN_TEMPLATE_LOADING`` config flag which when enabled will270 instruct Flask to explain how it locates templates. This should help271 users debug when the wrong templates are loaded.272- Enforce blueprint handling in the order they were registered for template273 loading.274- Ported test suite to py.test.275- Deprecated ``request.json`` in favour of ``request.get_json()``.276- Add "pretty" and "compressed" separators definitions in jsonify() method.277 Reduces JSON response size when JSONIFY_PRETTYPRINT_REGULAR=False by removing278 unnecessary white space included by default after separators.279- JSON responses are now terminated with a newline character, because it is a280 convention that UNIX text files end with a newline and some clients don't281 deal well when this newline is missing. See282 https://github.com/pallets/flask/pull/1262 -- this came up originally as a283 part of https://github.com/kennethreitz/httpbin/issues/168284- The automatically provided ``OPTIONS`` method is now correctly disabled if285 the user registered an overriding rule with the lowercase-version286 ``options`` (issue ``#1288``).287- ``flask.json.jsonify`` now supports the ``datetime.date`` type (pull request288 ``#1326``).289- Don't leak exception info of already catched exceptions to context teardown290 handlers (pull request ``#1393``).291- Allow custom Jinja environment subclasses (pull request ``#1422``).292- Updated extension dev guidelines.293294- ``flask.g`` now has ``pop()`` and ``setdefault`` methods.295- Turn on autoescape for ``flask.templating.render_template_string`` by default296 (pull request ``#1515``).297- ``flask.ext`` is now deprecated (pull request ``#1484``).298- ``send_from_directory`` now raises BadRequest if the filename is invalid on299 the server OS (pull request ``#1763``).300- Added the ``JSONIFY_MIMETYPE`` configuration variable (pull request ``#1728``).301- Exceptions during teardown handling will no longer leave bad application302 contexts lingering around.303304Version 0.10.2305--------------306307(bugfix release, release date to be announced)308309- Fixed broken `test_appcontext_signals()` test case.310- Raise an :exc:`AttributeError` in :func:`flask.helpers.find_package` with a311 useful message explaining why it is raised when a PEP 302 import hook is used312 without an `is_package()` method.313- Fixed an issue causing exceptions raised before entering a request or app314 context to be passed to teardown handlers.315- Fixed an issue with query parameters getting removed from requests in316 the test client when absolute URLs were requested.317- Made `@before_first_request` into a decorator as intended.318- Fixed an etags bug when sending a file streams with a name.319- Fixed `send_from_directory` not expanding to the application root path320 correctly.321- Changed logic of before first request handlers to flip the flag after322 invoking. This will allow some uses that are potentially dangerous but323 should probably be permitted.324- Fixed Python 3 bug when a handler from `app.url_build_error_handlers`325 reraises the `BuildError`.326327Version 0.10.1328--------------329330(bugfix release, released on June 14th 2013)331332- Fixed an issue where ``|tojson`` was not quoting single quotes which333 made the filter not work properly in HTML attributes. Now it's334 possible to use that filter in single quoted attributes. This should335 make using that filter with angular.js easier.336- Added support for byte strings back to the session system. This broke337 compatibility with the common case of people putting binary data for338 token verification into the session.339- Fixed an issue where registering the same method twice for the same endpoint340 would trigger an exception incorrectly.341342Version 0.10343------------344345Released on June 13th 2013, codename Limoncello.346347- Changed default cookie serialization format from pickle to JSON to348 limit the impact an attacker can do if the secret key leaks. See349 :ref:`upgrading-to-010` for more information.350- Added ``template_test`` methods in addition to the already existing351 ``template_filter`` method family.352- Added ``template_global`` methods in addition to the already existing353 ``template_filter`` method family.354- Set the content-length header for x-sendfile.355- ``tojson`` filter now does not escape script blocks in HTML5 parsers.356- ``tojson`` used in templates is now safe by default due. This was357 allowed due to the different escaping behavior.358- Flask will now raise an error if you attempt to register a new function359 on an already used endpoint.360- Added wrapper module around simplejson and added default serialization361 of datetime objects. This allows much easier customization of how362 JSON is handled by Flask or any Flask extension.363- Removed deprecated internal ``flask.session`` module alias. Use364 ``flask.sessions`` instead to get the session module. This is not to365 be confused with ``flask.session`` the session proxy.366- Templates can now be rendered without request context. The behavior is367 slightly different as the ``request``, ``session`` and ``g`` objects368 will not be available and blueprint's context processors are not369 called.370- The config object is now available to the template as a real global and371 not through a context processor which makes it available even in imported372 templates by default.373- Added an option to generate non-ascii encoded JSON which should result374 in less bytes being transmitted over the network. It's disabled by375 default to not cause confusion with existing libraries that might expect376 ``flask.json.dumps`` to return bytestrings by default.377- ``flask.g`` is now stored on the app context instead of the request378 context.379- ``flask.g`` now gained a ``get()`` method for not erroring out on non380 existing items.381- ``flask.g`` now can be used with the ``in`` operator to see what's defined382 and it now is iterable and will yield all attributes stored.383- ``flask.Flask.request_globals_class`` got renamed to384 ``flask.Flask.app_ctx_globals_class`` which is a better name to what it385 does since 0.10.386- `request`, `session` and `g` are now also added as proxies to the template387 context which makes them available in imported templates. One has to be388 very careful with those though because usage outside of macros might389 cause caching.390- Flask will no longer invoke the wrong error handlers if a proxy391 exception is passed through.392- Added a workaround for chrome's cookies in localhost not working393 as intended with domain names.394- Changed logic for picking defaults for cookie values from sessions395 to work better with Google Chrome.396- Added `message_flashed` signal that simplifies flashing testing.397- Added support for copying of request contexts for better working with398 greenlets.399- Removed custom JSON HTTP exception subclasses. If you were relying on them400 you can reintroduce them again yourself trivially. Using them however is401 strongly discouraged as the interface was flawed.402- Python requirements changed: requiring Python 2.6 or 2.7 now to prepare403 for Python 3.3 port.404- Changed how the teardown system is informed about exceptions. This is now405 more reliable in case something handles an exception halfway through406 the error handling process.407- Request context preservation in debug mode now keeps the exception408 information around which means that teardown handlers are able to409 distinguish error from success cases.410- Added the ``JSONIFY_PRETTYPRINT_REGULAR`` configuration variable.411- Flask now orders JSON keys by default to not trash HTTP caches due to412 different hash seeds between different workers.413- Added `appcontext_pushed` and `appcontext_popped` signals.414- The builtin run method now takes the ``SERVER_NAME`` into account when415 picking the default port to run on.416- Added `flask.request.get_json()` as a replacement for the old417 `flask.request.json` property.418419Version 0.9420-----------421422Released on July 1st 2012, codename Campari.423424- The :func:`flask.Request.on_json_loading_failed` now returns a JSON formatted425 response by default.426- The :func:`flask.url_for` function now can generate anchors to the427 generated links.428- The :func:`flask.url_for` function now can also explicitly generate429 URL rules specific to a given HTTP method.430- Logger now only returns the debug log setting if it was not set431 explicitly.432- Unregister a circular dependency between the WSGI environment and433 the request object when shutting down the request. This means that434 environ ``werkzeug.request`` will be ``None`` after the response was435 returned to the WSGI server but has the advantage that the garbage436 collector is not needed on CPython to tear down the request unless437 the user created circular dependencies themselves.438- Session is now stored after callbacks so that if the session payload439 is stored in the session you can still modify it in an after440 request callback.441- The :class:`flask.Flask` class will avoid importing the provided import name442 if it can (the required first parameter), to benefit tools which build Flask443 instances programmatically. The Flask class will fall back to using import444 on systems with custom module hooks, e.g. Google App Engine, or when the445 import name is inside a zip archive (usually a .egg) prior to Python 2.7.446- Blueprints now have a decorator to add custom template filters application447 wide, :meth:`flask.Blueprint.app_template_filter`.448- The Flask and Blueprint classes now have a non-decorator method for adding449 custom template filters application wide,450 :meth:`flask.Flask.add_template_filter` and451 :meth:`flask.Blueprint.add_app_template_filter`.452- The :func:`flask.get_flashed_messages` function now allows rendering flashed453 message categories in separate blocks, through a ``category_filter``454 argument.455- The :meth:`flask.Flask.run` method now accepts ``None`` for `host` and `port`456 arguments, using default values when ``None``. This allows for calling run457 using configuration values, e.g. ``app.run(app.config.get('MYHOST'),458 app.config.get('MYPORT'))``, with proper behavior whether or not a config459 file is provided.460- The :meth:`flask.render_template` method now accepts a either an iterable of461 template names or a single template name. Previously, it only accepted a462 single template name. On an iterable, the first template found is rendered.463- Added :meth:`flask.Flask.app_context` which works very similar to the464 request context but only provides access to the current application. This465 also adds support for URL generation without an active request context.466- View functions can now return a tuple with the first instance being an467 instance of :class:`flask.Response`. This allows for returning468 ``jsonify(error="error msg"), 400`` from a view function.469- :class:`~flask.Flask` and :class:`~flask.Blueprint` now provide a470 :meth:`~flask.Flask.get_send_file_max_age` hook for subclasses to override471 behavior of serving static files from Flask when using472 :meth:`flask.Flask.send_static_file` (used for the default static file473 handler) and :func:`~flask.helpers.send_file`. This hook is provided a474 filename, which for example allows changing cache controls by file extension.475 The default max-age for `send_file` and static files can be configured476 through a new ``SEND_FILE_MAX_AGE_DEFAULT`` configuration variable, which is477 used in the default `get_send_file_max_age` implementation.478- Fixed an assumption in sessions implementation which could break message479 flashing on sessions implementations which use external storage.480- Changed the behavior of tuple return values from functions. They are no481 longer arguments to the response object, they now have a defined meaning.482- Added :attr:`flask.Flask.request_globals_class` to allow a specific class to483 be used on creation of the :data:`~flask.g` instance of each request.484- Added `required_methods` attribute to view functions to force-add methods485 on registration.486- Added :func:`flask.after_this_request`.487- Added :func:`flask.stream_with_context` and the ability to push contexts488 multiple times without producing unexpected behavior.489490Version 0.8.1491-------------492493Bugfix release, released on July 1st 2012494495- Fixed an issue with the undocumented `flask.session` module to not496 work properly on Python 2.5. It should not be used but did cause497 some problems for package managers.498499Version 0.8500-----------501502Released on September 29th 2011, codename Rakija503504- Refactored session support into a session interface so that505 the implementation of the sessions can be changed without506 having to override the Flask class.507- Empty session cookies are now deleted properly automatically.508- View functions can now opt out of getting the automatic509 OPTIONS implementation.510- HTTP exceptions and Bad Request errors can now be trapped so that they511 show up normally in the traceback.512- Flask in debug mode is now detecting some common problems and tries to513 warn you about them.514- Flask in debug mode will now complain with an assertion error if a view515 was attached after the first request was handled. This gives earlier516 feedback when users forget to import view code ahead of time.517- Added the ability to register callbacks that are only triggered once at518 the beginning of the first request. (:meth:`Flask.before_first_request`)519- Malformed JSON data will now trigger a bad request HTTP exception instead520 of a value error which usually would result in a 500 internal server521 error if not handled. This is a backwards incompatible change.522- Applications now not only have a root path where the resources and modules523 are located but also an instance path which is the designated place to524 drop files that are modified at runtime (uploads etc.). Also this is525 conceptually only instance depending and outside version control so it's526 the perfect place to put configuration files etc. For more information527 see :ref:`instance-folders`.528- Added the ``APPLICATION_ROOT`` configuration variable.529- Implemented :meth:`~flask.testing.TestClient.session_transaction` to530 easily modify sessions from the test environment.531- Refactored test client internally. The ``APPLICATION_ROOT`` configuration532 variable as well as ``SERVER_NAME`` are now properly used by the test client533 as defaults.534- Added :attr:`flask.views.View.decorators` to support simpler decorating of535 pluggable (class-based) views.536- Fixed an issue where the test client if used with the "with" statement did not537 trigger the execution of the teardown handlers.538- Added finer control over the session cookie parameters.539- HEAD requests to a method view now automatically dispatch to the `get`540 method if no handler was implemented.541- Implemented the virtual :mod:`flask.ext` package to import extensions from.542- The context preservation on exceptions is now an integral component of543 Flask itself and no longer of the test client. This cleaned up some544 internal logic and lowers the odds of runaway request contexts in unittests.545546Version 0.7.3547-------------548549Bugfix release, release date to be decided550551- Fixed the Jinja2 environment's list_templates method not returning the552 correct names when blueprints or modules were involved.553554Version 0.7.2555-------------556557Bugfix release, released on July 6th 2011558559- Fixed an issue with URL processors not properly working on560 blueprints.561562Version 0.7.1563-------------564565Bugfix release, released on June 29th 2011566567- Added missing future import that broke 2.5 compatibility.568- Fixed an infinite redirect issue with blueprints.569570Version 0.7571-----------572573Released on June 28th 2011, codename Grappa574575- Added :meth:`~flask.Flask.make_default_options_response`576 which can be used by subclasses to alter the default577 behavior for ``OPTIONS`` responses.578- Unbound locals now raise a proper :exc:`RuntimeError` instead579 of an :exc:`AttributeError`.580- Mimetype guessing and etag support based on file objects is now581 deprecated for :func:`flask.send_file` because it was unreliable.582 Pass filenames instead or attach your own etags and provide a583 proper mimetype by hand.584- Static file handling for modules now requires the name of the585 static folder to be supplied explicitly. The previous autodetection586 was not reliable and caused issues on Google's App Engine. Until587 1.0 the old behavior will continue to work but issue dependency588 warnings.589- fixed a problem for Flask to run on jython.590- added a ``PROPAGATE_EXCEPTIONS`` configuration variable that can be591 used to flip the setting of exception propagation which previously592 was linked to ``DEBUG`` alone and is now linked to either ``DEBUG`` or593 ``TESTING``.594- Flask no longer internally depends on rules being added through the595 `add_url_rule` function and can now also accept regular werkzeug596 rules added to the url map.597- Added an `endpoint` method to the flask application object which598 allows one to register a callback to an arbitrary endpoint with599 a decorator.600- Use Last-Modified for static file sending instead of Date which601 was incorrectly introduced in 0.6.602- Added `create_jinja_loader` to override the loader creation process.603- Implemented a silent flag for `config.from_pyfile`.604- Added `teardown_request` decorator, for functions that should run at the end605 of a request regardless of whether an exception occurred. Also the behavior606 for `after_request` was changed. It's now no longer executed when an exception607 is raised. See :ref:`upgrading-to-new-teardown-handling`608- Implemented :func:`flask.has_request_context`609- Deprecated `init_jinja_globals`. Override the610 :meth:`~flask.Flask.create_jinja_environment` method instead to611 achieve the same functionality.612- Added :func:`flask.safe_join`613- The automatic JSON request data unpacking now looks at the charset614 mimetype parameter.615- Don't modify the session on :func:`flask.get_flashed_messages` if there616 are no messages in the session.617- `before_request` handlers are now able to abort requests with errors.618- it is not possible to define user exception handlers. That way you can619 provide custom error messages from a central hub for certain errors that620 might occur during request processing (for instance database connection621 errors, timeouts from remote resources etc.).622- Blueprints can provide blueprint specific error handlers.623- Implemented generic :ref:`views` (class-based views).624625Version 0.6.1626-------------627628Bugfix release, released on December 31st 2010629630- Fixed an issue where the default ``OPTIONS`` response was631 not exposing all valid methods in the ``Allow`` header.632- Jinja2 template loading syntax now allows "./" in front of633 a template load path. Previously this caused issues with634 module setups.635- Fixed an issue where the subdomain setting for modules was636 ignored for the static folder.637- Fixed a security problem that allowed clients to download arbitrary files638 if the host server was a windows based operating system and the client639 uses backslashes to escape the directory the files where exposed from.640641Version 0.6642-----------643644Released on July 27th 2010, codename Whisky645646- after request functions are now called in reverse order of647 registration.648- OPTIONS is now automatically implemented by Flask unless the649 application explicitly adds 'OPTIONS' as method to the URL rule.650 In this case no automatic OPTIONS handling kicks in.651- static rules are now even in place if there is no static folder652 for the module. This was implemented to aid GAE which will653 remove the static folder if it's part of a mapping in the .yml654 file.655- the :attr:`~flask.Flask.config` is now available in the templates656 as `config`.657- context processors will no longer override values passed directly658 to the render function.659- added the ability to limit the incoming request data with the660 new ``MAX_CONTENT_LENGTH`` configuration value.661- the endpoint for the :meth:`flask.Module.add_url_rule` method662 is now optional to be consistent with the function of the663 same name on the application object.664- added a :func:`flask.make_response` function that simplifies665 creating response object instances in views.666- added signalling support based on blinker. This feature is currently667 optional and supposed to be used by extensions and applications. If668 you want to use it, make sure to have `blinker`_ installed.669- refactored the way URL adapters are created. This process is now670 fully customizable with the :meth:`~flask.Flask.create_url_adapter`671 method.672- modules can now register for a subdomain instead of just an URL673 prefix. This makes it possible to bind a whole module to a674 configurable subdomain.675676.. _blinker: https://pypi.python.org/pypi/blinker677678Version 0.5.2679-------------680681Bugfix Release, released on July 15th 2010682683- fixed another issue with loading templates from directories when684 modules were used.685686Version 0.5.1687-------------688689Bugfix Release, released on July 6th 2010690691- fixes an issue with template loading from directories when modules692 where used.693694Version 0.5695-----------696697Released on July 6th 2010, codename Calvados698699- fixed a bug with subdomains that was caused by the inability to700 specify the server name. The server name can now be set with701 the ``SERVER_NAME`` config key. This key is now also used to set702 the session cookie cross-subdomain wide.703- autoescaping is no longer active for all templates. Instead it704 is only active for ``.html``, ``.htm``, ``.xml`` and ``.xhtml``.705 Inside templates this behavior can be changed with the706 ``autoescape`` tag.707- refactored Flask internally. It now consists of more than a708 single file.709- :func:`flask.send_file` now emits etags and has the ability to710 do conditional responses builtin.711- (temporarily) dropped support for zipped applications. This was a712 rarely used feature and led to some confusing behavior.713- added support for per-package template and static-file directories.714- removed support for `create_jinja_loader` which is no longer used715 in 0.5 due to the improved module support.716- added a helper function to expose files from any directory.717718Version 0.4719-----------720721Released on June 18th 2010, codename Rakia722723- added the ability to register application wide error handlers724 from modules.725- :meth:`~flask.Flask.after_request` handlers are now also invoked726 if the request dies with an exception and an error handling page727 kicks in.728- test client has not the ability to preserve the request context729 for a little longer. This can also be used to trigger custom730 requests that do not pop the request stack for testing.731- because the Python standard library caches loggers, the name of732 the logger is configurable now to better support unittests.733- added ``TESTING`` switch that can activate unittesting helpers.734- the logger switches to ``DEBUG`` mode now if debug is enabled.735736Version 0.3.1737-------------738739Bugfix release, released on May 28th 2010740741- fixed a error reporting bug with :meth:`flask.Config.from_envvar`742- removed some unused code from flask743- release does no longer include development leftover files (.git744 folder for themes, built documentation in zip and pdf file and745 some .pyc files)746747Version 0.3748-----------749750Released on May 28th 2010, codename Schnaps751752- added support for categories for flashed messages.753- the application now configures a :class:`logging.Handler` and will754 log request handling exceptions to that logger when not in debug755 mode. This makes it possible to receive mails on server errors756 for example.757- added support for context binding that does not require the use of758 the with statement for playing in the console.759- the request context is now available within the with statement making760 it possible to further push the request context or pop it.761- added support for configurations.762763Version 0.2764-----------765766Released on May 12th 2010, codename Jägermeister767768- various bugfixes769- integrated JSON support770- added :func:`~flask.get_template_attribute` helper function.771- :meth:`~flask.Flask.add_url_rule` can now also register a772 view function.773- refactored internal request dispatching.774- server listens on 127.0.0.1 by default now to fix issues with chrome.775- added external URL support.776- added support for :func:`~flask.send_file`777- module support and internal request handling refactoring778 to better support pluggable applications.779- sessions can be set to be permanent now on a per-session basis.780- better error reporting on missing secret keys.781- added support for Google Appengine.782783Version 0.1784-----------785786First public preview release.