Skip to content
Myr

Merge branch '2.1.x'

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

authored by David Lord · committed by David Lord · parents add53e1, 363be75 · Browse files · 2 files+194 added−217 removed
This commit

State

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

Diff stats

2 files+194 added−217 removed

  • other:+194 added−217 removed

2 files+194 added−217 removed

modified:docs/conf.py+1 added-1 removed
27 unmodified lines
28 "jinja": ("https://jinja.palletsprojects.com/", None),29 "itsdangerous": ("https://itsdangerous.palletsprojects.com/", None),30 "sqlalchemy": ("https://docs.sqlalchemy.org/", None),31 "wtforms": ("https://wtforms.readthedocs.io/", None),32 "blinker": ("https://pythonhosted.org/blinker/", None),32 "blinker": ("https://blinker.readthedocs.io/", None),33}34issues_github_path = "pallets/flask"3536# HTML -----------------------------------------------------------------
62 unmodified lines
modified:CHANGES.rst+193 added-216 removed
1.. currentmodule:: flask21Version 2.2.02-------------34Unreleased
287 unmodified lines
292 was not portable outside the ``flask`` command. Use293 ``click.get_current_context().obj`` if it's needed. :issue:`3552`294- The CLI shows better error messages when the app failed to load295 when looking up commands. :issue:`2741`298- Add :meth:`sessions.SessionInterface.get_cookie_name` to allow299 setting the session cookie name dynamically. :pr:`3369`300- Add :meth:`Config.from_file` to load config using arbitrary file296- Add ``SessionInterface.get_cookie_name`` to allow setting the297 session cookie name dynamically. :pr:`3369`298- Add ``Config.from_file`` to load config using arbitrary file299 loaders, such as ``toml.load`` or ``json.load``.302 :meth:`Config.from_json` is deprecated in favor of this. :pr:`3398`300 ``Config.from_json`` is deprecated in favor of this. :pr:`3398`301- The ``flask run`` command will only defer errors on reload. Errors302 present during the initial call will cause the server to exit with303 the traceback immediately. :issue:`3431`306- :func:`send_file` raises a :exc:`ValueError` when passed an307 :mod:`io` object in text mode. Previously, it would respond with308 200 OK and an empty file. :issue:`3358`304- ``send_file`` raises a ``ValueError`` when passed an ``io`` object305 in text mode. Previously, it would respond with 200 OK and an empty306 file. :issue:`3358`307- When using ad-hoc certificates, check for the cryptography library308 instead of PyOpenSSL. :pr:`3492`309- When specifying a factory function with ``FLASK_APP``, keyword310 argument can be passed. :issue:`3553`
102 unmodified lines
413 directly to the handler. The same is true if the handler is for the414 base ``HTTPException``. This makes error handler behavior more415 consistent. :pr:`3266`416419 - :meth:`Flask.finalize_request` is called for all unhandled417 - ``Flask.finalize_request`` is called for all unhandled418 exceptions even if there is no ``500`` error handler.419422- :attr:`Flask.logger` takes the same name as423 :attr:`Flask.name` (the value passed as424 ``Flask(import_name)``. This reverts 1.0's behavior of always425 logging to ``"flask.app"``, in order to support multiple apps in the426 same process. A warning will be shown if old configuration is420- ``Flask.logger`` takes the same name as ``Flask.name`` (the value421 passed as ``Flask(import_name)``. This reverts 1.0's behavior of422 always logging to ``"flask.app"``, in order to support multiple apps423 in the same process. A warning will be shown if old configuration is424 detected that needs to be moved. :issue:`2866`428- :meth:`flask.RequestContext.copy` includes the current session429 object in the request context copy. This prevents ``session``430 pointing to an out-of-date object. :issue:`2935`425- ``RequestContext.copy`` includes the current session object in the426 request context copy. This prevents ``session`` pointing to an427 out-of-date object. :issue:`2935`428- Using built-in RequestContext, unprintable Unicode characters in429 Host header will result in a HTTP 400 response and not HTTP 500 as430 previously. :pr:`2994`434- :func:`send_file` supports :class:`~os.PathLike` objects as435 described in PEP 0519, to support :mod:`pathlib` in Python 3.436 :pr:`3059`437- :func:`send_file` supports :class:`~io.BytesIO` partial content.431- ``send_file`` supports ``PathLike`` objects as described in432 :pep:`519`, to support ``pathlib`` in Python 3. :pr:`3059`433- ``send_file`` supports ``BytesIO`` partial content.434 :issue:`2957`439- :func:`open_resource` accepts the "rt" file mode. This still does440 the same thing as "r". :issue:`3163`441- The :attr:`MethodView.methods` attribute set in a base class is used442 by subclasses. :issue:`3138`443- :attr:`Flask.jinja_options` is a ``dict`` instead of an435- ``open_resource`` accepts the "rt" file mode. This still does the436 same thing as "r". :issue:`3163`437- The ``MethodView.methods`` attribute set in a base class is used by438 subclasses. :issue:`3138`439- ``Flask.jinja_options`` is a ``dict`` instead of an440 ``ImmutableDict`` to allow easier configuration. Changes must still441 be made before creating the environment. :pr:`3190`442- Flask's ``JSONMixin`` for the request and response wrappers was443 moved into Werkzeug. Use Werkzeug's version with Flask-specific
5 unmodified lines
449- Support ``static_url_path`` that ends with a forward slash.450 :issue:`3134`451- Support empty ``static_folder`` without requiring setting an empty452 ``static_url_path`` as well. :pr:`3124`457- :meth:`jsonify` supports :class:`dataclasses.dataclass` objects.458 :pr:`3195`459- Allow customizing the :attr:`Flask.url_map_class` used for routing.453- ``jsonify`` supports ``dataclass`` objects. :pr:`3195`454- Allow customizing the ``Flask.url_map_class`` used for routing.455 :pr:`3069`456- The development server port can be set to 0, which tells the OS to457 pick an available port. :issue:`2926`463- The return value from :meth:`cli.load_dotenv` is more consistent464 with the documentation. It will return ``False`` if python-dotenv is465 not installed, or if the given path isn't a file. :issue:`2937`458- The return value from ``cli.load_dotenv`` is more consistent with459 the documentation. It will return ``False`` if python-dotenv is not460 installed, or if the given path isn't a file. :issue:`2937`461- Signaling support has a stub for the ``connect_via`` method when462 the Blinker library is not installed. :pr:`3208`463- Add an ``--extra-files`` option to the ``flask run`` CLI command to464 specify extra files that will trigger the reloader on change.
30 unmodified lines
495 outside debug mode, so error handlers can still access it. This496 requires upgrading to Werkzeug 0.15.5. :issue:`3249`497- ``send_file`` url quotes the ":" and "/" characters for more498 compatible UTF-8 filename support in some browsers. :issue:`3074`504- Fixes for PEP451 import loaders and pytest 5.x. :issue:`3275`499- Fixes for :pep:`451` import loaders and pytest 5.x. :issue:`3275`500- Show message about dotenv on stderr instead of stdout. :issue:`3285`501502503Version 1.0.3504-------------505506Released 2019-05-17507513- :func:`send_file` encodes filenames as ASCII instead of Latin-1508- ``send_file`` encodes filenames as ASCII instead of Latin-1509 (ISO-8859-1). This fixes compatibility with Gunicorn, which is515 stricter about header encodings than PEP 3333. :issue:`2766`510 stricter about header encodings than :pep:`3333`. :issue:`2766`511- Allow custom CLIs using ``FlaskGroup`` to set the debug flag without512 it always being overwritten based on environment variables.513 :pr:`2765`514- ``flask --version`` outputs Werkzeug's version and simplifies the515 Python version. :pr:`2825`521- :func:`send_file` handles an ``attachment_filename`` that is a522 native Python 2 string (bytes) with UTF-8 coded bytes. :issue:`2933`516- ``send_file`` handles an ``attachment_filename`` that is a native517 Python 2 string (bytes) with UTF-8 coded bytes. :issue:`2933`518- A catch-all error handler registered for ``HTTPException`` will not519 handle ``RoutingException``, which is used internally during520 routing. This fixes the unexpected behavior that had been introduced521 in 1.0. :pr:`2986`
39 unmodified lines
561- Python 2.6 and 3.3 are no longer supported.562- Bump minimum dependency versions to the latest stable versions:563 Werkzeug >= 0.14, Jinja >= 2.10, itsdangerous >= 0.24, Click >= 5.1.564 :issue:`2586`570- Skip :meth:`app.run <Flask.run>` when a Flask application is run571 from the command line. This avoids some behavior that was confusing572 to debug.573- Change the default for :data:`JSONIFY_PRETTYPRINT_REGULAR` to574 ``False``. :func:`~json.jsonify` returns a compact format by575 default, and an indented format in debug mode. :pr:`2193`576- :meth:`Flask.__init__ <Flask>` accepts the ``host_matching``577 argument and sets it on :attr:`~Flask.url_map`. :issue:`1559`578- :meth:`Flask.__init__ <Flask>` accepts the ``static_host`` argument579 and passes it as the ``host`` argument when defining the static580 route. :issue:`1559`581- :func:`send_file` supports Unicode in ``attachment_filename``.565- Skip ``app.run`` when a Flask application is run from the command566 line. This avoids some behavior that was confusing to debug.567- Change the default for ``JSONIFY_PRETTYPRINT_REGULAR`` to568 ``False``. ``~json.jsonify`` returns a compact format by default,569 and an indented format in debug mode. :pr:`2193`570- ``Flask.__init__`` accepts the ``host_matching`` argument and sets571 it on ``Flask.url_map``. :issue:`1559`572- ``Flask.__init__`` accepts the ``static_host`` argument and passes573 it as the ``host`` argument when defining the static route.574 :issue:`1559`575- ``send_file`` supports Unicode in ``attachment_filename``.576 :pr:`2223`583- Pass ``_scheme`` argument from :func:`url_for` to584 :meth:`~Flask.handle_url_build_error`. :pr:`2017`585- :meth:`~Flask.add_url_rule` accepts the586 ``provide_automatic_options`` argument to disable adding the587 ``OPTIONS`` method. :pr:`1489`588- :class:`~views.MethodView` subclasses inherit method handlers from589 base classes. :pr:`1936`577- Pass ``_scheme`` argument from ``url_for`` to578 ``Flask.handle_url_build_error``. :pr:`2017`579- ``Flask.add_url_rule`` accepts the ``provide_automatic_options``580 argument to disable adding the ``OPTIONS`` method. :pr:`1489`581- ``MethodView`` subclasses inherit method handlers from base classes.582 :pr:`1936`583- Errors caused while opening the session at the beginning of the584 request are handled by the app's error handlers. :pr:`2254`592- Blueprints gained :attr:`~Blueprint.json_encoder` and593 :attr:`~Blueprint.json_decoder` attributes to override the app's585- Blueprints gained ``Blueprint.json_encoder`` and586 ``Blueprint.json_decoder`` attributes to override the app's587 encoder and decoder. :pr:`1898`595- :meth:`Flask.make_response` raises ``TypeError`` instead of588- ``Flask.make_response`` raises ``TypeError`` instead of589 ``ValueError`` for bad response types. The error messages have been590 improved to describe why the type is invalid. :pr:`2256`591- Add ``routes`` CLI command to output routes registered on the592 application. :pr:`2259`
6 unmodified lines
599- Auto-detect zero-argument app factory called ``create_app`` or600 ``make_app`` from ``FLASK_APP``. :pr:`2297`601- Factory functions are not required to take a ``script_info``602 parameter to work with the ``flask`` command. If they take a single610 parameter or a parameter named ``script_info``, the611 :class:`~cli.ScriptInfo` object will be passed. :pr:`2319`603 parameter or a parameter named ``script_info``, the ``ScriptInfo``604 object will be passed. :pr:`2319`605- ``FLASK_APP`` can be set to an app factory, with arguments if606 needed, for example ``FLASK_APP=myproject.app:create_app('dev')``.607 :pr:`2326`608- ``FLASK_APP`` can point to local packages that are not installed in609 editable mode, although ``pip install -e`` is still preferred.610 :pr:`2414`618- The :class:`~views.View` class attribute619 :attr:`~views.View.provide_automatic_options` is set in620 :meth:`~views.View.as_view`, to be detected by621 :meth:`~Flask.add_url_rule`. :pr:`2316`611- The ``View`` class attribute612 ``View.provide_automatic_options`` is set in ``View.as_view``, to be613 detected by ``Flask.add_url_rule``. :pr:`2316`614- Error handling will try handlers registered for ``blueprint, code``,615 ``app, code``, ``blueprint, exception``, ``app, exception``.616 :pr:`2314`617- ``Cookie`` is added to the response's ``Vary`` header if the session618 is accessed at all during the request (and not deleted). :pr:`2288`627- :meth:`~Flask.test_request_context` accepts ``subdomain`` and619- ``Flask.test_request_context`` accepts ``subdomain`` and620 ``url_scheme`` arguments for use when building the base URL.621 :pr:`1621`630- Set :data:`APPLICATION_ROOT` to ``'/'`` by default. This was already631 the implicit default when it was set to ``None``.632- :data:`TRAP_BAD_REQUEST_ERRORS` is enabled by default in debug mode.622- Set ``APPLICATION_ROOT`` to ``'/'`` by default. This was already the623 implicit default when it was set to ``None``.624- ``TRAP_BAD_REQUEST_ERRORS`` is enabled by default in debug mode.625 ``BadRequestKeyError`` has a message with the bad key in debug mode626 instead of the generic bad request message. :pr:`2348`635- Allow registering new tags with636 :class:`~json.tag.TaggedJSONSerializer` to support storing other637 types in the session cookie. :pr:`2352`627- Allow registering new tags with ``TaggedJSONSerializer`` to support628 storing other types in the session cookie. :pr:`2352`629- Only open the session if the request has not been pushed onto the639 context stack yet. This allows :func:`~stream_with_context`640 generators to access the same session that the containing view uses.641 :pr:`2354`630 context stack yet. This allows ``stream_with_context`` generators to631 access the same session that the containing view uses. :pr:`2354`632- Add ``json`` keyword argument for the test client request methods.633 This will dump the given object as JSON and set the appropriate634 content type. :pr:`2358`645- Extract JSON handling to a mixin applied to both the646 :class:`Request` and :class:`Response` classes. This adds the647 :meth:`~Response.is_json` and :meth:`~Response.get_json` methods to648 the response to make testing JSON response much easier. :pr:`2358`635- Extract JSON handling to a mixin applied to both the ``Request`` and636 ``Response`` classes. This adds the ``Response.is_json`` and637 ``Response.get_json`` methods to the response to make testing JSON638 response much easier. :pr:`2358`639- Removed error handler caching because it caused unexpected results640 for some exception inheritance hierarchies. Register handlers641 explicitly for each exception if you want to avoid traversing the642 MRO. :pr:`2362`643- Fix incorrect JSON encoding of aware, non-UTC datetimes. :pr:`2374`644- Template auto reloading will honor debug mode even even if655 :attr:`~Flask.jinja_env` was already accessed. :pr:`2373`645 ``Flask.jinja_env`` was already accessed. :pr:`2373`646- The following old deprecated code was removed. :issue:`2385`647648 - ``flask.ext`` - import extensions directly by their name instead649 of through the ``flask.ext`` namespace. For example,650 ``import flask.ext.sqlalchemy`` becomes651 ``import flask_sqlalchemy``.652 - ``Flask.init_jinja_globals`` - extend663 :meth:`Flask.create_jinja_environment` instead.653 ``Flask.create_jinja_environment`` instead.654 - ``Flask.error_handlers`` - tracked by665 :attr:`Flask.error_handler_spec`, use :meth:`Flask.errorhandler`655 ``Flask.error_handler_spec``, use ``Flask.errorhandler``656 to register handlers.657 - ``Flask.request_globals_class`` - use668 :attr:`Flask.app_ctx_globals_class` instead.669 - ``Flask.static_path`` - use :attr:`Flask.static_url_path`670 instead.671 - ``Request.module`` - use :attr:`Request.blueprint` instead.658 ``Flask.app_ctx_globals_class`` instead.659 - ``Flask.static_path`` - use ``Flask.static_url_path`` instead.660 - ``Request.module`` - use ``Request.blueprint`` instead.661673- The :attr:`Request.json` property is no longer deprecated.674 :issue:`1421`675- Support passing a :class:`~werkzeug.test.EnvironBuilder` or ``dict``676 to :meth:`test_client.open <werkzeug.test.Client.open>`. :pr:`2412`677- The ``flask`` command and :meth:`Flask.run` will load environment662- The ``Request.json`` property is no longer deprecated. :issue:`1421`663- Support passing a ``EnvironBuilder`` or ``dict`` to664 ``test_client.open``. :pr:`2412`665- The ``flask`` command and ``Flask.run`` will load environment666 variables from ``.env`` and ``.flaskenv`` files if python-dotenv is667 installed. :pr:`2416`668- When passing a full URL to the test client, the scheme in the URL is681 used instead of :data:`PREFERRED_URL_SCHEME`. :pr:`2430`682- :attr:`Flask.logger` has been simplified. ``LOGGER_NAME`` and669 used instead of ``PREFERRED_URL_SCHEME``. :pr:`2430`670- ``Flask.logger`` has been simplified. ``LOGGER_NAME`` and671 ``LOGGER_HANDLER_POLICY`` config was removed. The logger is always672 named ``flask.app``. The level is only set on first access, it685 doesn't check :attr:`Flask.debug` each time. Only one format is686 used, not different ones depending on :attr:`Flask.debug`. No687 handlers are removed, and a handler is only added if no handlers are688 already configured. :pr:`2436`673 doesn't check ``Flask.debug`` each time. Only one format is used,674 not different ones depending on ``Flask.debug``. No handlers are675 removed, and a handler is only added if no handlers are already676 configured. :pr:`2436`677- Blueprint view function names may not contain dots. :pr:`2450`678- Fix a ``ValueError`` caused by invalid ``Range`` requests in some679 cases. :issue:`2526`680- The development server uses threads by default. :pr:`2529`693- Loading config files with ``silent=True`` will ignore694 :data:`~errno.ENOTDIR` errors. :pr:`2581`681- Loading config files with ``silent=True`` will ignore ``ENOTDIR``682 errors. :pr:`2581`683- Pass ``--cert`` and ``--key`` options to ``flask run`` to run the684 development server over HTTPS. :pr:`2606`697- Added :data:`SESSION_COOKIE_SAMESITE` to control the ``SameSite``685- Added ``SESSION_COOKIE_SAMESITE`` to control the ``SameSite``686 attribute on the session cookie. :pr:`2607`699- Added :meth:`~flask.Flask.test_cli_runner` to create a Click runner700 that can invoke Flask CLI commands for testing. :pr:`2636`687- Added ``Flask.test_cli_runner`` to create a Click runner that can688 invoke Flask CLI commands for testing. :pr:`2636`689- Subdomain matching is disabled by default and setting702 :data:`SERVER_NAME` does not implicitly enable it. It can be enabled703 by passing ``subdomain_matching=True`` to the ``Flask`` constructor.690 ``SERVER_NAME`` does not implicitly enable it. It can be enabled by691 passing ``subdomain_matching=True`` to the ``Flask`` constructor.692 :pr:`2635`693- A single trailing slash is stripped from the blueprint694 ``url_prefix`` when it is registered with the app. :pr:`2629`707- :meth:`Request.get_json` doesn't cache the result if parsing fails708 when ``silent`` is true. :issue:`2651`709- :func:`Request.get_json` no longer accepts arbitrary encodings.710 Incoming JSON should be encoded using UTF-8 per :rfc:`8259`, but711 Flask will autodetect UTF-8, -16, or -32. :pr:`2691`712- Added :data:`MAX_COOKIE_SIZE` and :attr:`Response.max_cookie_size`713 to control when Werkzeug warns about large cookies that browsers may695- ``Request.get_json`` doesn't cache the result if parsing fails when696 ``silent`` is true. :issue:`2651`697- ``Request.get_json`` no longer accepts arbitrary encodings. Incoming698 JSON should be encoded using UTF-8 per :rfc:`8259`, but Flask will699 autodetect UTF-8, -16, or -32. :pr:`2691`700- Added ``MAX_COOKIE_SIZE`` and ``Response.max_cookie_size`` to701 control when Werkzeug warns about large cookies that browsers may702 ignore. :pr:`2693`703- Updated documentation theme to make docs look better in small704 windows. :pr:`2709`705- Rewrote the tutorial docs and example project to take a more
21 unmodified lines
727--------------728729Released 2018-04-26730743- :func:`Request.get_json` no longer accepts arbitrary encodings.731- ``Request.get_json`` no longer accepts arbitrary encodings.732 Incoming JSON should be encoded using UTF-8 per :rfc:`8259`, but733 Flask will autodetect UTF-8, -16, or -32. :issue:`2692`734- Fix a Python warning about imports when using ``python -m flask``.735 :issue:`2666`
61 unmodified lines
797------------798799Released 2016-05-29, codename Absinthe800813- Added support to serializing top-level arrays to814 :func:`flask.jsonify`. This introduces a security risk in ancient815 browsers.801- Added support to serializing top-level arrays to ``jsonify``. This802 introduces a security risk in ancient browsers.803- Added before_render_template signal.817- Added ``**kwargs`` to :meth:`flask.Test.test_client` to support818 passing additional keyword arguments to the constructor of819 :attr:`flask.Flask.test_client_class`.804- Added ``**kwargs`` to ``Flask.test_client`` to support passing805 additional keyword arguments to the constructor of806 ``Flask.test_client_class``.807- Added ``SESSION_REFRESH_EACH_REQUEST`` config key that controls the808 set-cookie behavior. If set to ``True`` a permanent session will be809 refreshed each request and get their lifetime extended, if set to810 ``False`` it will only be modified if the session actually modifies.
1 unmodified line
812 expire if the browser window closes.813- Made Flask support custom JSON mimetypes for incoming data.814- Added support for returning tuples in the form ``(response,815 headers)`` from a view function.829- Added :meth:`flask.Config.from_json`.830- Added :attr:`flask.Flask.config_class`.831- Added :meth:`flask.Config.get_namespace`.816- Added ``Config.from_json``.817- Added ``Flask.config_class``.818- Added ``Config.get_namespace``.819- Templates are no longer automatically reloaded outside of debug820 mode. This can be configured with the new ``TEMPLATES_AUTO_RELOAD``821 config key.822- Added a workaround for a limitation in Python 3.3's namespace823 loader.824- Added support for explicit root paths when using Python 3.3's825 namespace packages.839- Added :command:`flask` and the ``flask.cli`` module to start the826- Added ``flask`` and the ``flask.cli`` module to start the827 local debug server through the click CLI system. This is recommended828 over the old ``flask.run()`` method as it works faster and more829 reliable due to a different design and also replaces830 ``Flask-Script``.
2 unmodified lines
833 exceptions (in ``werkzeug.exceptions``). This makes it possible for834 an extension author to create exceptions that will by default result835 in the HTTP error of their choosing, but may be caught with a custom836 error handler if desired.850- Added :meth:`flask.Config.from_mapping`.837- Added ``Config.from_mapping``.838- Flask will now log by default even if debug is disabled. The log839 format is now hardcoded but the default log handling can be disabled840 through the ``LOGGER_HANDLER_POLICY`` configuration key.841- Removed deprecated module functionality.
9 unmodified lines
851 ``JSONIFY_PRETTYPRINT_REGULAR=False`` by removing unnecessary white852 space included by default after separators.853- JSON responses are now terminated with a newline character, because854 it is a convention that UNIX text files end with a newline and some868 clients don't deal well when this newline is missing. This came up869 originally as a part of870 https://github.com/postmanlabs/httpbin/issues/168. :pr:`1262`855 clients don't deal well when this newline is missing. :pr:`1262`856- The automatically provided ``OPTIONS`` method is now correctly857 disabled if the user registered an overriding rule with the858 lowercase-version ``options``. :issue:`1288`859- ``flask.json.jsonify`` now supports the ``datetime.date`` type.
11 unmodified lines
871- Added the ``JSONIFY_MIMETYPE`` configuration variable. :pr:`1728`872- Exceptions during teardown handling will no longer leave bad873 application contexts lingering around.874- Fixed broken ``test_appcontext_signals()`` test case.890- Raise an :exc:`AttributeError` in :func:`flask.helpers.find_package`891 with a useful message explaining why it is raised when a PEP 302892 import hook is used without an ``is_package()`` method.875- Raise an ``AttributeError`` in ``helpers.find_package`` with a876 useful message explaining why it is raised when a :pep:`302` import877 hook is used without an ``is_package()`` method.878- Fixed an issue causing exceptions raised before entering a request879 or app context to be passed to teardown handlers.880- Fixed an issue with query parameters getting removed from requests881 in the test client when absolute URLs were requested.
107 unmodified lines
989-----------990991Released 2012-07-01, codename Campari9921008- The :func:`flask.Request.on_json_loading_failed` now returns a JSON1009 formatted response by default.1010- The :func:`flask.url_for` function now can generate anchors to the1011 generated links.1012- The :func:`flask.url_for` function now can also explicitly generate1013 URL rules specific to a given HTTP method.993- The ``Request.on_json_loading_failed`` now returns a JSON formatted994 response by default.995- The ``url_for`` function now can generate anchors to the generated996 links.997- The ``url_for`` function now can also explicitly generate URL rules998 specific to a given HTTP method.999- Logger now only returns the debug log setting if it was not set1000 explicitly.1001- Unregister a circular dependency between the WSGI environment and1002 the request object when shutting down the request. This means that
3 unmodified lines
1006 the user created circular dependencies themselves.1007- Session is now stored after callbacks so that if the session payload1008 is stored in the session you can still modify it in an after request1009 callback.1025- The :class:`flask.Flask` class will avoid importing the provided1026 import name if it can (the required first parameter), to benefit1027 tools which build Flask instances programmatically. The Flask class1028 will fall back to using import on systems with custom module hooks,1029 e.g. Google App Engine, or when the import name is inside a zip1030 archive (usually a .egg) prior to Python 2.7.1010- The ``Flask`` class will avoid importing the provided import name if1011 it can (the required first parameter), to benefit tools which build1012 Flask instances programmatically. The Flask class will fall back to1013 using import on systems with custom module hooks, e.g. Google App1014 Engine, or when the import name is inside a zip archive (usually an1015 egg) prior to Python 2.7.1016- Blueprints now have a decorator to add custom template filters1032 application wide, :meth:`flask.Blueprint.app_template_filter`.1017 application wide, ``Blueprint.app_template_filter``.1018- The Flask and Blueprint classes now have a non-decorator method for1019 adding custom template filters application wide,1035 :meth:`flask.Flask.add_template_filter` and1036 :meth:`flask.Blueprint.add_app_template_filter`.1037- The :func:`flask.get_flashed_messages` function now allows rendering1038 flashed message categories in separate blocks, through a1039 ``category_filter`` argument.1040- The :meth:`flask.Flask.run` method now accepts ``None`` for ``host``1041 and ``port`` arguments, using default values when ``None``. This1042 allows for calling run using configuration values, e.g.1020 ``Flask.add_template_filter`` and1021 ``Blueprint.add_app_template_filter``.1022- The ``get_flashed_messages`` function now allows rendering flashed1023 message categories in separate blocks, through a ``category_filter``1024 argument.1025- The ``Flask.run`` method now accepts ``None`` for ``host`` and1026 ``port`` arguments, using default values when ``None``. This allows1027 for calling run using configuration values, e.g.1028 ``app.run(app.config.get('MYHOST'), app.config.get('MYPORT'))``,1029 with proper behavior whether or not a config file is provided.1045- The :meth:`flask.render_template` method now accepts a either an1046 iterable of template names or a single template name. Previously, it1047 only accepted a single template name. On an iterable, the first1048 template found is rendered.1049- Added :meth:`flask.Flask.app_context` which works very similar to1050 the request context but only provides access to the current1051 application. This also adds support for URL generation without an1052 active request context.1030- The ``render_template`` method now accepts a either an iterable of1031 template names or a single template name. Previously, it only1032 accepted a single template name. On an iterable, the first template1033 found is rendered.1034- Added ``Flask.app_context`` which works very similar to the request1035 context but only provides access to the current application. This1036 also adds support for URL generation without an active request1037 context.1038- View functions can now return a tuple with the first instance being1054 an instance of :class:`flask.Response`. This allows for returning1039 an instance of ``Response``. This allows for returning1040 ``jsonify(error="error msg"), 400`` from a view function.1056- :class:`~flask.Flask` and :class:`~flask.Blueprint` now provide a1057 :meth:`~flask.Flask.get_send_file_max_age` hook for subclasses to1058 override behavior of serving static files from Flask when using1059 :meth:`flask.Flask.send_static_file` (used for the default static1060 file handler) and :func:`~flask.helpers.send_file`. This hook is1041- ``Flask`` and ``Blueprint`` now provide a ``get_send_file_max_age``1042 hook for subclasses to override behavior of serving static files1043 from Flask when using ``Flask.send_static_file`` (used for the1044 default static file handler) and ``helpers.send_file``. This hook is1045 provided a filename, which for example allows changing cache1046 controls by file extension. The default max-age for ``send_file``1047 and static files can be configured through a new1048 ``SEND_FILE_MAX_AGE_DEFAULT`` configuration variable, which is used
3 unmodified lines
1052 storage.1053- Changed the behavior of tuple return values from functions. They are1054 no longer arguments to the response object, they now have a defined1055 meaning.1072- Added :attr:`flask.Flask.request_globals_class` to allow a specific1073 class to be used on creation of the :data:`~flask.g` instance of1074 each request.1056- Added ``Flask.request_globals_class`` to allow a specific class to1057 be used on creation of the ``g`` instance of each request.1058- Added ``required_methods`` attribute to view functions to force-add1059 methods on registration.1077- Added :func:`flask.after_this_request`.1078- Added :func:`flask.stream_with_context` and the ability to push1079 contexts multiple times without producing unexpected behavior.1060- Added ``flask.after_this_request``.1061- Added ``flask.stream_with_context`` and the ability to push contexts1062 multiple times without producing unexpected behavior.106310641065Version 0.8.11066-------------
24 unmodified lines
1091 view was attached after the first request was handled. This gives1092 earlier feedback when users forget to import view code ahead of1093 time.1094- Added the ability to register callbacks that are only triggered once1112 at the beginning of the first request. (``before_first_request``)1095 at the beginning of the first request with1096 ``Flask.before_first_request``.1097- Malformed JSON data will now trigger a bad request HTTP exception1098 instead of a value error which usually would result in a 5001099 internal server error if not handled. This is a backwards1100 incompatible change.
3 unmodified lines
1104 etc.). Also this is conceptually only instance depending and outside1105 version control so it's the perfect place to put configuration files1106 etc.1107- Added the ``APPLICATION_ROOT`` configuration variable.1124- Implemented :meth:`~flask.testing.TestClient.session_transaction` to1125 easily modify sessions from the test environment.1108- Implemented ``TestClient.session_transaction`` to easily modify1109 sessions from the test environment.1110- Refactored test client internally. The ``APPLICATION_ROOT``1111 configuration variable as well as ``SERVER_NAME`` are now properly1112 used by the test client as defaults.1129- Added :attr:`flask.views.View.decorators` to support simpler1130 decorating of pluggable (class-based) views.1113- Added ``View.decorators`` to support simpler decorating of pluggable1114 (class-based) views.1115- Fixed an issue where the test client if used with the "with"1116 statement did not trigger the execution of the teardown handlers.1117- Added finer control over the session cookie parameters.1118- HEAD requests to a method view now automatically dispatch to the1119 ``get`` method if no handler was implemented.1136- Implemented the virtual :mod:`flask.ext` package to import1137 extensions from.1120- Implemented the virtual ``flask.ext`` package to import extensions1121 from.1122- The context preservation on exceptions is now an integral component1123 of Flask itself and no longer of the test client. This cleaned up1124 some internal logic and lowers the odds of runaway request contexts1125 in unittests.
24 unmodified lines
1150-----------11511152Released 2011-06-28, codename Grappa11531170- Added :meth:`~flask.Flask.make_default_options_response` which can1171 be used by subclasses to alter the default behavior for ``OPTIONS``1172 responses.1173- Unbound locals now raise a proper :exc:`RuntimeError` instead of an1174 :exc:`AttributeError`.1154- Added ``Flask.make_default_options_response`` which can be used by1155 subclasses to alter the default behavior for ``OPTIONS`` responses.1156- Unbound locals now raise a proper ``RuntimeError`` instead of an1157 ``AttributeError``.1158- Mimetype guessing and etag support based on file objects is now1176 deprecated for :func:`flask.send_file` because it was unreliable.1177 Pass filenames instead or attach your own etags and provide a proper1159 deprecated for ``send_file`` because it was unreliable. Pass1160 filenames instead or attach your own etags and provide a proper1161 mimetype by hand.1162- Static file handling for modules now requires the name of the static1163 folder to be supplied explicitly. The previous autodetection was not1164 reliable and caused issues on Google's App Engine. Until 1.0 the old
17 unmodified lines
1182- Added ``teardown_request`` decorator, for functions that should run1183 at the end of a request regardless of whether an exception occurred.1184 Also the behavior for ``after_request`` was changed. It's now no1185 longer executed when an exception is raised.1203- Implemented :func:`flask.has_request_context`1186- Implemented ``has_request_context``.1187- Deprecated ``init_jinja_globals``. Override the1205 :meth:`~flask.Flask.create_jinja_environment` method instead to1206 achieve the same functionality.1207- Added :func:`flask.safe_join`1188 ``Flask.create_jinja_environment`` method instead to achieve the1189 same functionality.1190- Added ``safe_join``.1191- The automatic JSON request data unpacking now looks at the charset1192 mimetype parameter.1210- Don't modify the session on :func:`flask.get_flashed_messages` if1211 there are no messages in the session.1193- Don't modify the session on ``get_flashed_messages`` if there are no1194 messages in the session.1195- ``before_request`` handlers are now able to abort requests with1196 errors.1197- It is not possible to define user exception handlers. That way you1198 can provide custom error messages from a central hub for certain
33 unmodified lines
1232 this case no automatic OPTIONS handling kicks in.1233- Static rules are now even in place if there is no static folder for1234 the module. This was implemented to aid GAE which will remove the1235 static folder if it's part of a mapping in the .yml file.1253- The :attr:`~flask.Flask.config` is now available in the templates as1254 ``config``.1236- ``Flask.config`` is now available in the templates as ``config``.1237- Context processors will no longer override values passed directly to1238 the render function.1239- Added the ability to limit the incoming request data with the new1240 ``MAX_CONTENT_LENGTH`` configuration value.1259- The endpoint for the :meth:`flask.Module.add_url_rule` method is now1260 optional to be consistent with the function of the same name on the1241- The endpoint for the ``Module.add_url_rule`` method is now optional1242 to be consistent with the function of the same name on the1243 application object.1262- Added a :func:`flask.make_response` function that simplifies1263 creating response object instances in views.1244- Added a ``make_response`` function that simplifies creating response1245 object instances in views.1246- Added signalling support based on blinker. This feature is currently1247 optional and supposed to be used by extensions and applications. If1266 you want to use it, make sure to have `blinker`_ installed.1248 you want to use it, make sure to have ``blinker`` installed.1249- Refactored the way URL adapters are created. This process is now1268 fully customizable with the :meth:`~flask.Flask.create_url_adapter`1269 method.1250 fully customizable with the ``Flask.create_url_adapter`` method.1251- Modules can now register for a subdomain instead of just an URL1252 prefix. This makes it possible to bind a whole module to a1253 configurable subdomain.12541274.. _blinker: https://pypi.org/project/blinker/125512761256Version 0.5.21257-------------12581259Released 2010-07-15
24 unmodified lines
1284 only active for ``.html``, ``.htm``, ``.xml`` and ``.xhtml``. Inside1285 templates this behavior can be changed with the ``autoescape`` tag.1286- Refactored Flask internally. It now consists of more than a single1287 file.1309- :func:`flask.send_file` now emits etags and has the ability to do1310 conditional responses builtin.1288- ``send_file`` now emits etags and has the ability to do conditional1289 responses builtin.1290- (temporarily) dropped support for zipped applications. This was a1291 rarely used feature and led to some confusing behavior.1292- Added support for per-package template and static-file directories.1293- Removed support for ``create_jinja_loader`` which is no longer used
7 unmodified lines
1301Released 2010-06-18, codename Rakia13021303- Added the ability to register application wide error handlers from1304 modules.1326- :meth:`~flask.Flask.after_request` handlers are now also invoked if1327 the request dies with an exception and an error handling page kicks1328 in.1305- ``Flask.after_request`` handlers are now also invoked if the request1306 dies with an exception and an error handling page kicks in.1307- Test client has not the ability to preserve the request context for1308 a little longer. This can also be used to trigger custom requests1309 that do not pop the request stack for testing.1310- Because the Python standard library caches loggers, the name of the
6 unmodified lines
1317-------------13181319Released 2010-05-2813201343- Fixed a error reporting bug with :meth:`flask.Config.from_envvar`1344- Removed some unused code from flask1321- Fixed a error reporting bug with ``Config.from_envvar``.1322- Removed some unused code.1323- Release does no longer include development leftover files (.git1324 folder for themes, built documentation in zip and pdf file and some1325 .pyc files)1326
3 unmodified lines
13301331Released 2010-05-28, codename Schnaps13321333- Added support for categories for flashed messages.1356- The application now configures a :class:`logging.Handler` and will1357 log request handling exceptions to that logger when not in debug1358 mode. This makes it possible to receive mails on server errors for1334- The application now configures a ``logging.Handler`` and will log1335 request handling exceptions to that logger when not in debug mode.1336 This makes it possible to receive mails on server errors for1337 example.1338- Added support for context binding that does not require the use of1339 the with statement for playing in the console.1340- The request context is now available within the with statement
7 unmodified lines
1348Released 2010-05-12, codename J?germeister13491350- Various bugfixes1351- Integrated JSON support1374- Added :func:`~flask.get_template_attribute` helper function.1375- :meth:`~flask.Flask.add_url_rule` can now also register a view1376 function.1352- Added ``get_template_attribute`` helper function.1353- ``Flask.add_url_rule`` can now also register a view function.1354- Refactored internal request dispatching.1355- Server listens on 127.0.0.1 by default now to fix issues with1356 chrome.1357- Added external URL support.1381- Added support for :func:`~flask.send_file`1358- Added support for ``send_file``.1359- Module support and internal request handling refactoring to better1360 support pluggable applications.1361- Sessions can be set to be permanent now on a per-session basis.1362- Better error reporting on missing secret keys.
9 unmodified lines