<h2>Version 3.1.1<aclass="headerlink"href="#version-3-1-1"title="Link to this heading">¶</a></h2>
<p>Unreleased</p>
<ulclass="simple">
<li><p>Fix type hint for <codeclass="code docutils literal notranslate"><spanclass="pre">cli_runner.invoke</span></code>. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/5645">#5645</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">flask</span><spanclass="pre">--help</span></code> loads the app and plugins first to make sure all commands
are shown. :issue:5673`</p></li>
<li><p>Mark sans-io base class as being able to handle views that return
<codeclass="docutils literal notranslate"><spanclass="pre">AsyncIterable</span></code>. This is not accurate for Flask, but makes typing easier
for Quart. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/5659">#5659</a></p></li>
</ul>
</section>
<sectionid="version-3-1-0">
<h2>Version 3.1.0<aclass="headerlink"href="#version-3-1-0"title="Link to this heading">¶</a></h2>
<p>Released 2024-11-13</p>
<ulclass="simple">
<li><p>Drop support for Python 3.8. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/5623">#5623</a></p></li>
<li><p>Update minimum dependency versions to latest feature releases.
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Flask.open_resource</span></code>/<codeclass="docutils literal notranslate"><spanclass="pre">open_instance_resource</span></code> and
<codeclass="docutils literal notranslate"><spanclass="pre">Blueprint.open_resource</span></code> take an <codeclass="docutils literal notranslate"><spanclass="pre">encoding</span></code> parameter to use when
opening in text mode. It defaults to <codeclass="docutils literal notranslate"><spanclass="pre">utf-8</span></code>. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/5504">#5504</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Request.max_content_length</span></code> can be customized per-request instead of only
through the <codeclass="docutils literal notranslate"><spanclass="pre">MAX_CONTENT_LENGTH</span></code> config. Added
<codeclass="docutils literal notranslate"><spanclass="pre">MAX_FORM_MEMORY_SIZE</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">MAX_FORM_PARTS</span></code> config. Added documentation
about resource limits to the security page. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/5625">#5625</a></p></li>
<li><p>Add support for the <codeclass="docutils literal notranslate"><spanclass="pre">Partitioned</span></code> cookie attribute (CHIPS), with the
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">-e</span><spanclass="pre">path</span></code> takes precedence over default <codeclass="docutils literal notranslate"><spanclass="pre">.env</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">.flaskenv</span></code> files.
<codeclass="docutils literal notranslate"><spanclass="pre">load_dotenv</span></code> loads default files in addition to a path unless
<codeclass="docutils literal notranslate"><spanclass="pre">load_defaults=False</span></code> is passed. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/5628">#5628</a></p></li>
<li><p>Support key rotation with the <codeclass="docutils literal notranslate"><spanclass="pre">SECRET_KEY_FALLBACKS</span></code> config, a list of old
secret keys that can still be used for unsigning. Extensions will need to
<li><p>Fix how setting <codeclass="docutils literal notranslate"><spanclass="pre">host_matching=True</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">subdomain_matching=False</span></code>
interacts with <codeclass="docutils literal notranslate"><spanclass="pre">SERVER_NAME</span></code>. Setting <codeclass="docutils literal notranslate"><spanclass="pre">SERVER_NAME</span></code> no longer restricts
requests to only that domain. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/5553">#5553</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Request.trusted_hosts</span></code> is checked during routing, and can be set through
the <codeclass="docutils literal notranslate"><spanclass="pre">TRUSTED_HOSTS</span></code> config. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/5636">#5636</a></p></li>
</ul>
</section>
<sectionid="version-3-0-3">
<h2>Version 3.0.3<aclass="headerlink"href="#version-3-0-3"title="Link to this heading">¶</a></h2>
<p>Released 2024-04-07</p>
<ulclass="simple">
<li><p>The default <codeclass="docutils literal notranslate"><spanclass="pre">hashlib.sha1</span></code> may not be available in FIPS builds. Don’t
access it at import time so the developer has time to change the default.
<li><p>Don’t initialize the <codeclass="docutils literal notranslate"><spanclass="pre">cli</span></code> attribute in the sansio scaffold, but rather in
the <codeclass="docutils literal notranslate"><spanclass="pre">Flask</span></code> concrete class. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/5270">#5270</a></p></li>
</ul>
</section>
<sectionid="version-3-0-2">
<h2>Version 3.0.2<aclass="headerlink"href="#version-3-0-2"title="Link to this heading">¶</a></h2>
<p>Released 2024-02-03</p>
<ulclass="simple">
<li><p>Correct type for <codeclass="docutils literal notranslate"><spanclass="pre">jinja_loader</span></code> property. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/5388">#5388</a></p></li>
<li><p>Fix error with <codeclass="docutils literal notranslate"><spanclass="pre">--extra-files</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">--exclude-patterns</span></code> CLI options.
<h2>Version 3.0.1<aclass="headerlink"href="#version-3-0-1"title="Link to this heading">¶</a></h2>
<p>Released 2024-01-18</p>
<ulclass="simple">
<li><p>Correct type for <codeclass="docutils literal notranslate"><spanclass="pre">path</span></code> argument to <codeclass="docutils literal notranslate"><spanclass="pre">send_file</span></code>. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/5336">#5336</a></p></li>
<li><p>Fix a typo in an error message for the <codeclass="docutils literal notranslate"><spanclass="pre">flask</span><spanclass="pre">run</span><spanclass="pre">--key</span></code> option. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/5344">#5344</a></p></li>
<li><p>Session data is untagged without relying on the built-in <codeclass="docutils literal notranslate"><spanclass="pre">json.loads</span></code>
<codeclass="docutils literal notranslate"><spanclass="pre">object_hook</span></code>. This allows other JSON providers that don’t implement that.
<li><p>Address more type findings when using mypy strict mode. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/5383">#5383</a></p></li>
</ul>
</section>
<sectionid="version-3-0-0">
<h2>Version 3.0.0<aclass="headerlink"href="#version-3-0-0"title="Link to this heading">¶</a></h2>
<li><p>Restructure the code such that the Flask (app) and Blueprint
classes have Sans-IO bases. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/5127">#5127</a></p></li>
<li><p>Allow self as an argument to url_for. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/5264">#5264</a></p></li>
<li><p>Require Werkzeug >= 3.0.0.</p></li>
</ul>
</section>
<sectionid="version-2-3-3">
<h2>Version 2.3.3<aclass="headerlink"href="#version-2-3-3"title="Link to this heading">¶</a></h2>
<p>Released 2023-08-21</p>
<ulclass="simple">
<li><p>Python 3.12 compatibility.</p></li>
<li><p>Require Werkzeug >= 2.3.7.</p></li>
<li><p>Use <codeclass="docutils literal notranslate"><spanclass="pre">flit_core</span></code> instead of <codeclass="docutils literal notranslate"><spanclass="pre">setuptools</span></code> as build backend.</p></li>
<li><p>Refactor how an app’s root and instance paths are determined. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/5160">#5160</a></p></li>
</ul>
</section>
<sectionid="version-2-3-2">
<h2>Version 2.3.2<aclass="headerlink"href="#version-2-3-2"title="Link to this heading">¶</a></h2>
<p>Released 2023-05-01</p>
<ulclass="simple">
<li><p>Set <codeclass="docutils literal notranslate"><spanclass="pre">Vary:</span><spanclass="pre">Cookie</span></code> header when the session is accessed, modified, or refreshed.</p></li>
<li><p>Update Werkzeug requirement to >=2.3.3 to apply recent bug fixes.
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">push</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">pop</span></code> methods of the deprecated <codeclass="docutils literal notranslate"><spanclass="pre">_app_ctx_stack</span></code> and
<codeclass="docutils literal notranslate"><spanclass="pre">_request_ctx_stack</span></code> objects are removed. <codeclass="docutils literal notranslate"><spanclass="pre">top</span></code> still exists to give
extensions more time to update, but it will be removed.</p></li>
<codeclass="docutils literal notranslate"><spanclass="pre">JSONIFY_PRETTYPRINT_REGULAR</span></code> config keys are removed.</p></li>
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">app.before_first_request</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">bp.before_app_first_request</span></code> decorators
are removed.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">json_encoder</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">json_decoder</span></code> attributes on app and blueprint, and the
corresponding <codeclass="docutils literal notranslate"><spanclass="pre">json.JSONEncoder</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">JSONDecoder</span></code> classes, are removed.</p></li>
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">json.htmlsafe_dumps</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">htmlsafe_dump</span></code> functions are removed.</p></li>
<li><p>Calling setup methods on blueprints after registration is an error instead of a
<li><p>Importing <codeclass="docutils literal notranslate"><spanclass="pre">escape</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">Markup</span></code> from <codeclass="docutils literal notranslate"><spanclass="pre">flask</span></code> is deprecated. Import them
directly from <codeclass="docutils literal notranslate"><spanclass="pre">markupsafe</span></code> instead. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/4996">#4996</a></p></li>
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">app.got_first_request</span></code> property is deprecated. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/4997">#4997</a></p></li>
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">locked_cached_property</span></code> decorator is deprecated. Use a lock inside the
decorated function if locking is needed. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4993">#4993</a></p></li>
<li><p>Signals are always available. <codeclass="docutils literal notranslate"><spanclass="pre">blinker>=1.6.2</span></code> is a required dependency. The
<codeclass="docutils literal notranslate"><spanclass="pre">signals_available</span></code> attribute is deprecated. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/5056">#5056</a></p></li>
<li><p>Signals support <codeclass="docutils literal notranslate"><spanclass="pre">async</span></code> subscriber functions. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/5049">#5049</a></p></li>
<li><p>Remove uses of locks that could cause requests to block each other very briefly.
<li><p>Use modern packaging metadata with <codeclass="docutils literal notranslate"><spanclass="pre">pyproject.toml</span></code> instead of <codeclass="docutils literal notranslate"><spanclass="pre">setup.cfg</span></code>.
<li><p>Ensure subdomains are applied with nested blueprints. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4834">#4834</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">config.from_file</span></code> can use <codeclass="docutils literal notranslate"><spanclass="pre">text=False</span></code> to indicate that the parser wants a
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">SESSION_COOKIE_DOMAIN</span></code> does not fall back to <codeclass="docutils literal notranslate"><spanclass="pre">SERVER_NAME</span></code>. The default is not
to set the domain, which modern browsers interpret as an exact match rather than
a subdomain match. Warnings about <codeclass="docutils literal notranslate"><spanclass="pre">localhost</span></code> and IP addresses are also removed.
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">routes</span></code> command shows each rule’s <codeclass="docutils literal notranslate"><spanclass="pre">subdomain</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">host</span></code> when domain
matching is in use. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/5004">#5004</a></p></li>
<li><p>Use postponed evaluation of annotations. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/5071">#5071</a></p></li>
</ul>
</section>
<sectionid="version-2-2-5">
<h2>Version 2.2.5<aclass="headerlink"href="#version-2-2-5"title="Link to this heading">¶</a></h2>
<p>Released 2023-05-02</p>
<ulclass="simple">
<li><p>Update for compatibility with Werkzeug 2.3.3.</p></li>
<li><p>Set <codeclass="docutils literal notranslate"><spanclass="pre">Vary:</span><spanclass="pre">Cookie</span></code> header when the session is accessed, modified, or refreshed.</p></li>
</ul>
</section>
<sectionid="version-2-2-4">
<h2>Version 2.2.4<aclass="headerlink"href="#version-2-2-4"title="Link to this heading">¶</a></h2>
<p>Released 2023-04-25</p>
<ulclass="simple">
<li><p>Update for compatibility with Werkzeug 2.3.</p></li>
</ul>
</section>
<sectionid="version-2-2-3">
<h2>Version 2.2.3<aclass="headerlink"href="#version-2-2-3"title="Link to this heading">¶</a></h2>
<p>Released 2023-02-15</p>
<ulclass="simple">
<li><p>Autoescape is enabled by default for <codeclass="docutils literal notranslate"><spanclass="pre">.svg</span></code> template files. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4831">#4831</a></p></li>
<li><p>Fix the type of <codeclass="docutils literal notranslate"><spanclass="pre">template_folder</span></code> to accept <codeclass="docutils literal notranslate"><spanclass="pre">pathlib.Path</span></code>. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4892">#4892</a></p></li>
<li><p>Add <codeclass="docutils literal notranslate"><spanclass="pre">--debug</span></code> option to the <codeclass="docutils literal notranslate"><spanclass="pre">flask</span><spanclass="pre">run</span></code> command. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4777">#4777</a></p></li>
</ul>
</section>
<sectionid="version-2-2-2">
<h2>Version 2.2.2<aclass="headerlink"href="#version-2-2-2"title="Link to this heading">¶</a></h2>
<p>Released 2022-08-08</p>
<ulclass="simple">
<li><p>Update Werkzeug dependency to >= 2.2.2. This includes fixes related
to the new faster router, header parsing, and the development
<li><p>Fix the default value for <codeclass="docutils literal notranslate"><spanclass="pre">app.env</span></code> to be <codeclass="docutils literal notranslate"><spanclass="pre">"production"</span></code>. This
<h2>Version 2.2.1<aclass="headerlink"href="#version-2-2-1"title="Link to this heading">¶</a></h2>
<p>Released 2022-08-03</p>
<ulclass="simple">
<li><p>Setting or accessing <codeclass="docutils literal notranslate"><spanclass="pre">json_encoder</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">json_decoder</span></code> raises a
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">flask.abort</span></code> will call <codeclass="docutils literal notranslate"><spanclass="pre">app.aborter</span></code>.
<codeclass="docutils literal notranslate"><spanclass="pre">Flask.aborter_class</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">Flask.make_aborter</span></code> can be used
to customize this aborter. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4567">#4567</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">flask.json</span></code> is an instance of <codeclass="docutils literal notranslate"><spanclass="pre">JSONProvider</span></code>. A different
provider can be set to use a different JSON library.
<codeclass="docutils literal notranslate"><spanclass="pre">flask.jsonify</span></code> will call <codeclass="docutils literal notranslate"><spanclass="pre">app.json.response</span></code>, other
functions in <codeclass="docutils literal notranslate"><spanclass="pre">flask.json</span></code> will call corresponding functions in
<codeclass="docutils literal notranslate"><spanclass="pre">JSONIFY_MIMETYPE</span></code>, and <codeclass="docutils literal notranslate"><spanclass="pre">JSONIFY_PRETTYPRINT_REGULAR</span></code> are
<li><p>Setting custom <codeclass="docutils literal notranslate"><spanclass="pre">json_encoder</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">json_decoder</span></code> classes on the
app or a blueprint, and the corresponding <codeclass="docutils literal notranslate"><spanclass="pre">json.JSONEncoder</span></code> and
<codeclass="docutils literal notranslate"><spanclass="pre">JSONDecoder</span></code> classes, are deprecated. JSON behavior can now be
overridden using the <codeclass="docutils literal notranslate"><spanclass="pre">app.json</span></code> provider interface. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/4692">#4692</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">json.htmlsafe_dumps</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">json.htmlsafe_dump</span></code> are deprecated,
the function is built-in to Jinja now. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/4692">#4692</a></p></li>
<li><p>Refactor <codeclass="docutils literal notranslate"><spanclass="pre">register_error_handler</span></code> to consolidate error checking.
Rewrite some error messages to be more consistent. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4559">#4559</a></p></li>
<li><p>Use Blueprint decorators and functions intended for setup after
registering the blueprint will show a warning. In the next version,
this will become an error just like the application setup methods.
<li><p>Add <codeclass="docutils literal notranslate"><spanclass="pre">--env-file</span></code> option to the <codeclass="docutils literal notranslate"><spanclass="pre">flask</span></code> CLI. This allows
specifying a dotenv file to load in addition to <codeclass="docutils literal notranslate"><spanclass="pre">.env</span></code> and
<li><p>It is no longer required to decorate custom CLI commands on
<codeclass="docutils literal notranslate"><spanclass="pre">app.cli</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">blueprint.cli</span></code> with <codeclass="docutils literal notranslate"><spanclass="pre">@with_appcontext</span></code>, an app
context will already be active at that point. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/2410">#2410</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">SessionInterface.get_expiration_time</span></code> uses a timezone-aware
<li><p>View functions can return generators directly instead of wrapping
them in a <codeclass="docutils literal notranslate"><spanclass="pre">Response</span></code>. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/4629">#4629</a></p></li>
<li><p>Add <codeclass="docutils literal notranslate"><spanclass="pre">stream_template</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">stream_template_string</span></code> functions to
render a template as a stream of pieces. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/4629">#4629</a></p></li>
<li><p>A new implementation of context preservation during debugging and
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">request</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">g</span></code>, and other context-locals point to the
correct data when running code in the interactive debugger
<li><p>Teardown functions are always run at the end of the request,
even if the context is preserved. They are also run after the
preserved context is popped.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">stream_with_context</span></code> preserves context separately from a
<codeclass="docutils literal notranslate"><spanclass="pre">with</span><spanclass="pre">client</span></code> block. It will be cleaned up when
<codeclass="docutils literal notranslate"><spanclass="pre">response.get_data()</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">response.close()</span></code> is called.</p></li>
</ul>
</li>
<li><p>Allow returning a list from a view function, to convert it to a
JSON response like a dict is. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4672">#4672</a></p></li>
<li><p>When type checking, allow <codeclass="docutils literal notranslate"><spanclass="pre">TypedDict</span></code> to be returned from view
<li><p>Remove the <codeclass="docutils literal notranslate"><spanclass="pre">--eager-loading/--lazy-loading</span></code> options from the
<codeclass="docutils literal notranslate"><spanclass="pre">flask</span><spanclass="pre">run</span></code> command. The app is always eager loaded the first
time, then lazily loaded in the reloader. The reloader always prints
errors immediately but continues serving. Remove the internal
<codeclass="docutils literal notranslate"><spanclass="pre">DispatchingApp</span></code> middleware used by the previous implementation.
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">--cert</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">--key</span></code> options on <codeclass="docutils literal notranslate"><spanclass="pre">flask</span><spanclass="pre">run</span></code> can be given
in either order. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4459">#4459</a></p></li>
</ul>
</section>
<sectionid="version-2-1-1">
<h2>Version 2.1.1<aclass="headerlink"href="#version-2-1-1"title="Link to this heading">¶</a></h2>
<p>Released on 2022-03-30</p>
<ulclass="simple">
<li><p>Set the minimum required version of importlib_metadata to 3.6.0,
which is required on Python < 3.10. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4502">#4502</a></p></li>
</ul>
</section>
<sectionid="version-2-1-0">
<h2>Version 2.1.0<aclass="headerlink"href="#version-2-1-0"title="Link to this heading">¶</a></h2>
<p>Released 2022-03-28</p>
<ulclass="simple">
<li><p>Drop support for Python 3.6. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/4335">#4335</a></p></li>
<li><p>Update Click dependency to >= 8.0. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/4008">#4008</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">json</span></code> functions no longer take an <codeclass="docutils literal notranslate"><spanclass="pre">encoding</span></code> parameter.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">safe_join</span></code> is removed, use <codeclass="docutils literal notranslate"><spanclass="pre">werkzeug.utils.safe_join</span></code>
instead.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">total_seconds</span></code> is removed, use <codeclass="docutils literal notranslate"><spanclass="pre">timedelta.total_seconds</span></code>
instead.</p></li>
<li><p>The same blueprint cannot be registered with the same name. Use
<codeclass="docutils literal notranslate"><spanclass="pre">name=</span></code> when registering to specify a unique name.</p></li>
<li><p>The test client’s <codeclass="docutils literal notranslate"><spanclass="pre">as_tuple</span></code> parameter is removed. Use
<li><p>Some parameters in <codeclass="docutils literal notranslate"><spanclass="pre">send_file</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">send_from_directory</span></code> were
renamed in 2.0. The deprecation period for the old names is extended
to 2.2. Be sure to test with deprecation warnings visible.</p>
<ul>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">attachment_filename</span></code> is renamed to <codeclass="docutils literal notranslate"><spanclass="pre">download_name</span></code>.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">cache_timeout</span></code> is renamed to <codeclass="docutils literal notranslate"><spanclass="pre">max_age</span></code>.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">add_etags</span></code> is renamed to <codeclass="docutils literal notranslate"><spanclass="pre">etag</span></code>.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">filename</span></code> is renamed to <codeclass="docutils literal notranslate"><spanclass="pre">path</span></code>.</p></li>
</ul>
</li>
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">RequestContext.g</span></code> property is deprecated. Use <codeclass="docutils literal notranslate"><spanclass="pre">g</span></code> directly
or <codeclass="docutils literal notranslate"><spanclass="pre">AppContext.g</span></code> instead. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/3898">#3898</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">copy_current_request_context</span></code> can decorate async functions.
<li><p>Add an <codeclass="docutils literal notranslate"><spanclass="pre">--exclude-patterns</span></code> option to the <codeclass="docutils literal notranslate"><spanclass="pre">flask</span><spanclass="pre">run</span></code> CLI
command to specify patterns that will be ignored by the reloader.
<li><p>When using lazy loading (the default with the debugger), the Click
context from the <codeclass="docutils literal notranslate"><spanclass="pre">flask</span><spanclass="pre">run</span></code> command remains available in the
<h2>Version 2.0.3<aclass="headerlink"href="#version-2-0-3"title="Link to this heading">¶</a></h2>
<p>Released 2022-02-14</p>
<ulclass="simple">
<li><p>The test client’s <codeclass="docutils literal notranslate"><spanclass="pre">as_tuple</span></code> parameter is deprecated and will be
removed in Werkzeug 2.1. It is now also deprecated in Flask, to be
removed in Flask 2.1, while remaining compatible with both in
2.0.x. Use <codeclass="docutils literal notranslate"><spanclass="pre">response.request.environ</span></code> instead. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/4341">#4341</a></p></li>
<li><p>Fix type annotation for <codeclass="docutils literal notranslate"><spanclass="pre">errorhandler</span></code> decorator. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4295">#4295</a></p></li>
<li><p>Revert a change to the CLI that caused it to hide <codeclass="docutils literal notranslate"><spanclass="pre">ImportError</span></code>
tracebacks when importing the application. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4307">#4307</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">app.json_encoder</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">json_decoder</span></code> are only passed to
<codeclass="docutils literal notranslate"><spanclass="pre">dumps</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">loads</span></code> if they have custom behavior. This improves
performance, mainly on PyPy. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4349">#4349</a></p></li>
<li><p>Clearer error message when <codeclass="docutils literal notranslate"><spanclass="pre">after_this_request</span></code> is used outside a
<h2>Version 2.0.2<aclass="headerlink"href="#version-2-0-2"title="Link to this heading">¶</a></h2>
<p>Released 2021-10-04</p>
<ulclass="simple">
<li><p>Fix type annotation for <codeclass="docutils literal notranslate"><spanclass="pre">teardown_*</span></code> methods. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4093">#4093</a></p></li>
<li><p>Fix type annotation for <codeclass="docutils literal notranslate"><spanclass="pre">before_request</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">before_app_request</span></code>
<li><p>Fixed the issue where typing requires template global
decorators to accept functions with no arguments. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4098">#4098</a></p></li>
<li><p>Support View and MethodView instances with async handlers. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4112">#4112</a></p></li>
<li><p>Enhance typing of <codeclass="docutils literal notranslate"><spanclass="pre">app.errorhandler</span></code> decorator. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4095">#4095</a></p></li>
<li><p>Fix registering a blueprint twice with differing names. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4124">#4124</a></p></li>
<li><p>Fix the type of <codeclass="docutils literal notranslate"><spanclass="pre">static_folder</span></code> to accept <codeclass="docutils literal notranslate"><spanclass="pre">pathlib.Path</span></code>.
<h2>Version 2.0.1<aclass="headerlink"href="#version-2-0-1"title="Link to this heading">¶</a></h2>
<p>Released 2021-05-21</p>
<ulclass="simple">
<li><p>Re-add the <codeclass="docutils literal notranslate"><spanclass="pre">filename</span></code> parameter in <codeclass="docutils literal notranslate"><spanclass="pre">send_from_directory</span></code>. The
<codeclass="docutils literal notranslate"><spanclass="pre">filename</span></code> parameter has been renamed to <codeclass="docutils literal notranslate"><spanclass="pre">path</span></code>, the old name
is deprecated. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/4019">#4019</a></p></li>
<li><p>Mark top-level names as exported so type checking understands
imports in user projects. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4024">#4024</a></p></li>
<li><p>Fix type annotation for <codeclass="docutils literal notranslate"><spanclass="pre">g</span></code> and inform mypy that it is a namespace
object that has arbitrary attributes. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4020">#4020</a></p></li>
<li><p>Fix some types that weren’t available in Python 3.6.0. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4040">#4040</a></p></li>
<li><p>Improve typing for <codeclass="docutils literal notranslate"><spanclass="pre">send_file</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">send_from_directory</span></code>, and
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">register_blueprint</span></code> takes a <codeclass="docutils literal notranslate"><spanclass="pre">name</span></code> option to change the
(pre-dotted) name the blueprint is registered with. This allows the
same blueprint to be registered multiple times with unique names for
<codeclass="docutils literal notranslate"><spanclass="pre">url_for</span></code>. Registering the same blueprint with the same name
multiple times is deprecated. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/1091">#1091</a></p></li>
<li><p>Improve typing for <codeclass="docutils literal notranslate"><spanclass="pre">stream_with_context</span></code>. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/4052">#4052</a></p></li>
</ul>
</section>
<sectionid="version-2-0-0">
<h2>Version 2.0.0<aclass="headerlink"href="#version-2-0-0"title="Link to this heading">¶</a></h2>
<p>Released 2021-05-11</p>
<ulclass="simple">
<li><p>Drop support for Python 2 and 3.5.</p></li>
<li><p>Bump minimum versions of other Pallets projects: Werkzeug >= 2,
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">encoding</span></code> option to JSON functions is deprecated. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/3562">#3562</a></p></li>
<li><p>Passing <codeclass="docutils literal notranslate"><spanclass="pre">script_info</span></code> to app factory functions is deprecated. This
was not portable outside the <codeclass="docutils literal notranslate"><spanclass="pre">flask</span></code> command. Use
<codeclass="docutils literal notranslate"><spanclass="pre">click.get_current_context().obj</span></code> if it’s needed. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/3552">#3552</a></p></li>
<li><p>The CLI shows better error messages when the app failed to load
when looking up commands. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/2741">#2741</a></p></li>
<li><p>Add <codeclass="docutils literal notranslate"><spanclass="pre">SessionInterface.get_cookie_name</span></code> to allow setting the
session cookie name dynamically. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/3369">#3369</a></p></li>
<li><p>Add <codeclass="docutils literal notranslate"><spanclass="pre">Config.from_file</span></code> to load config using arbitrary file
loaders, such as <codeclass="docutils literal notranslate"><spanclass="pre">toml.load</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">json.load</span></code>.
<codeclass="docutils literal notranslate"><spanclass="pre">Config.from_json</span></code> is deprecated in favor of this. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/3398">#3398</a></p></li>
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">flask</span><spanclass="pre">run</span></code> command will only defer errors on reload. Errors
present during the initial call will cause the server to exit with
the traceback immediately. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/3431">#3431</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">send_file</span></code> raises a <codeclass="docutils literal notranslate"><spanclass="pre">ValueError</span></code> when passed an <codeclass="docutils literal notranslate"><spanclass="pre">io</span></code> object
in text mode. Previously, it would respond with 200 OK and an empty
<li><p>When using ad-hoc certificates, check for the cryptography library
instead of PyOpenSSL. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/3492">#3492</a></p></li>
<li><p>When specifying a factory function with <codeclass="docutils literal notranslate"><spanclass="pre">FLASK_APP</span></code>, keyword
argument can be passed. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/3553">#3553</a></p></li>
<li><p>When loading a <codeclass="docutils literal notranslate"><spanclass="pre">.env</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">.flaskenv</span></code> file, the current working
directory is no longer changed to the location of the file.
<li><p>When returning a <codeclass="docutils literal notranslate"><spanclass="pre">(response,</span><spanclass="pre">headers)</span></code> tuple from a view, the
headers replace rather than extend existing headers on the response.
For example, this allows setting the <codeclass="docutils literal notranslate"><spanclass="pre">Content-Type</span></code> for
<codeclass="docutils literal notranslate"><spanclass="pre">jsonify()</span></code>. Use <codeclass="docutils literal notranslate"><spanclass="pre">response.headers.extend()</span></code> if extending is
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">Scaffold</span></code> class provides a common API for the <codeclass="docutils literal notranslate"><spanclass="pre">Flask</span></code> and
<codeclass="docutils literal notranslate"><spanclass="pre">Blueprint</span></code> classes. <codeclass="docutils literal notranslate"><spanclass="pre">Blueprint</span></code> information is stored in
attributes just like <codeclass="docutils literal notranslate"><spanclass="pre">Flask</span></code>, rather than opaque lambda functions.
This is intended to improve consistency and maintainability.
<li><p>Include <codeclass="docutils literal notranslate"><spanclass="pre">samesite</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">secure</span></code> options when removing the
<li><p>Support passing a <codeclass="docutils literal notranslate"><spanclass="pre">pathlib.Path</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">static_folder</span></code>. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/3579">#3579</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">send_file</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">send_from_directory</span></code> are wrappers around the
implementations in <codeclass="docutils literal notranslate"><spanclass="pre">werkzeug.utils</span></code>. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/3828">#3828</a></p></li>
<li><p>Some <codeclass="docutils literal notranslate"><spanclass="pre">send_file</span></code> parameters have been renamed, the old names are
deprecated. <codeclass="docutils literal notranslate"><spanclass="pre">attachment_filename</span></code> is renamed to <codeclass="docutils literal notranslate"><spanclass="pre">download_name</span></code>.
<codeclass="docutils literal notranslate"><spanclass="pre">cache_timeout</span></code> is renamed to <codeclass="docutils literal notranslate"><spanclass="pre">max_age</span></code>. <codeclass="docutils literal notranslate"><spanclass="pre">add_etags</span></code> is
renamed to <codeclass="docutils literal notranslate"><spanclass="pre">etag</span></code>. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/3828, 3883">#3828, 3883</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">send_file</span></code> passes <codeclass="docutils literal notranslate"><spanclass="pre">download_name</span></code> even if
<codeclass="docutils literal notranslate"><spanclass="pre">as_attachment=False</span></code> by using <codeclass="docutils literal notranslate"><spanclass="pre">Content-Disposition:</span><spanclass="pre">inline</span></code>.
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">send_file</span></code> sets <codeclass="docutils literal notranslate"><spanclass="pre">conditional=True</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">max_age=None</span></code> by
default. <codeclass="docutils literal notranslate"><spanclass="pre">Cache-Control</span></code> is set to <codeclass="docutils literal notranslate"><spanclass="pre">no-cache</span></code> if <codeclass="docutils literal notranslate"><spanclass="pre">max_age</span></code> is
not set, otherwise <codeclass="docutils literal notranslate"><spanclass="pre">public</span></code>. This tells browsers to validate
conditional requests instead of using a timed cache. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/3828">#3828</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">helpers.safe_join</span></code> is deprecated. Use
<li><p>Set the default encoding to “UTF-8” when loading <codeclass="docutils literal notranslate"><spanclass="pre">.env</span></code> and
<codeclass="docutils literal notranslate"><spanclass="pre">.flaskenv</span></code> files to allow to use non-ASCII characters. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/3931">#3931</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">flask</span><spanclass="pre">shell</span></code> sets up tab and history completion like the default
<codeclass="docutils literal notranslate"><spanclass="pre">python</span></code> shell if <codeclass="docutils literal notranslate"><spanclass="pre">readline</span></code> is installed. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/3941">#3941</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">helpers.total_seconds()</span></code> is deprecated. Use
<li><p>Add type hinting. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/3973">#3973</a>.</p></li>
</ul>
</section>
<sectionid="version-1-1-4">
<h2>Version 1.1.4<aclass="headerlink"href="#version-1-1-4"title="Link to this heading">¶</a></h2>
<p>Released 2021-05-13</p>
<ulclass="simple">
<li><p>Update <codeclass="docutils literal notranslate"><spanclass="pre">static_folder</span></code> to use <codeclass="docutils literal notranslate"><spanclass="pre">_compat.fspath</span></code> instead of
<li><p>Re-add support for passing a <codeclass="docutils literal notranslate"><spanclass="pre">pathlib.Path</span></code> for <codeclass="docutils literal notranslate"><spanclass="pre">static_folder</span></code>.
<h2>Version 1.1.2<aclass="headerlink"href="#version-1-1-2"title="Link to this heading">¶</a></h2>
<p>Released 2020-04-03</p>
<ulclass="simple">
<li><p>Work around an issue when running the <codeclass="docutils literal notranslate"><spanclass="pre">flask</span></code> command with an
external debugger on Windows. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/3297">#3297</a></p></li>
<li><p>The static route will not catch all URLs if the <codeclass="docutils literal notranslate"><spanclass="pre">Flask</span></code>
<codeclass="docutils literal notranslate"><spanclass="pre">static_folder</span></code> argument ends with a slash. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/3452">#3452</a></p></li>
</ul>
</section>
<sectionid="version-1-1-1">
<h2>Version 1.1.1<aclass="headerlink"href="#version-1-1-1"title="Link to this heading">¶</a></h2>
<p>Released 2019-07-08</p>
<ulclass="simple">
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">flask.json_available</span></code> flag was added back for compatibility
with some extensions. It will raise a deprecation warning when used,
and will be removed in version 2.0.0. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/3288">#3288</a></p></li>
</ul>
</section>
<sectionid="version-1-1-0">
<h2>Version 1.1.0<aclass="headerlink"href="#version-1-1-0"title="Link to this heading">¶</a></h2>
<p>Released 2019-07-04</p>
<ulclass="simple">
<li><p>Bump minimum Werkzeug version to >= 0.15.</p></li>
<li><p>Drop support for Python 3.4.</p></li>
<li><p>Error handlers for <codeclass="docutils literal notranslate"><spanclass="pre">InternalServerError</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">500</span></code> will always be
passed an instance of <codeclass="docutils literal notranslate"><spanclass="pre">InternalServerError</span></code>. If they are invoked
due to an unhandled exception, that original exception is now
available as <codeclass="docutils literal notranslate"><spanclass="pre">e.original_exception</span></code> rather than being passed
directly to the handler. The same is true if the handler is for the
base <codeclass="docutils literal notranslate"><spanclass="pre">HTTPException</span></code>. This makes error handler behavior more
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Flask.finalize_request</span></code> is called for all unhandled
exceptions even if there is no <codeclass="docutils literal notranslate"><spanclass="pre">500</span></code> error handler.</p></li>
</ul>
</li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Flask.logger</span></code> takes the same name as <codeclass="docutils literal notranslate"><spanclass="pre">Flask.name</span></code> (the value
passed as <codeclass="docutils literal notranslate"><spanclass="pre">Flask(import_name)</span></code>. This reverts 1.0’s behavior of
always logging to <codeclass="docutils literal notranslate"><spanclass="pre">"flask.app"</span></code>, in order to support multiple apps
in the same process. A warning will be shown if old configuration is
detected that needs to be moved. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/2866">#2866</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">RequestContext.copy</span></code> includes the current session object in the
request context copy. This prevents <codeclass="docutils literal notranslate"><spanclass="pre">session</span></code> pointing to an
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">send_file</span></code> supports <codeclass="docutils literal notranslate"><spanclass="pre">PathLike</span></code> objects as described in
<spanclass="target"id="index-0"></span><aclass="pep reference external"href="https://peps.python.org/pep-0519/"><strong>PEP 519</strong></a>, to support <codeclass="docutils literal notranslate"><spanclass="pre">pathlib</span></code> in Python 3. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/3059">#3059</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Flask.jinja_options</span></code> is a <codeclass="docutils literal notranslate"><spanclass="pre">dict</span></code> instead of an
<codeclass="docutils literal notranslate"><spanclass="pre">ImmutableDict</span></code> to allow easier configuration. Changes must still
be made before creating the environment. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/3190">#3190</a></p></li>
<li><p>Flask’s <codeclass="docutils literal notranslate"><spanclass="pre">JSONMixin</span></code> for the request and response wrappers was
moved into Werkzeug. Use Werkzeug’s version with Flask-specific
support. This bumps the Werkzeug dependency to >= 0.15.
<li><p>The development server port can be set to 0, which tells the OS to
pick an available port. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/2926">#2926</a></p></li>
<li><p>The return value from <codeclass="docutils literal notranslate"><spanclass="pre">cli.load_dotenv</span></code> is more consistent with
the documentation. It will return <codeclass="docutils literal notranslate"><spanclass="pre">False</span></code> if python-dotenv is not
installed, or if the given path isn’t a file. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/2937">#2937</a></p></li>
<li><p>Signaling support has a stub for the <codeclass="docutils literal notranslate"><spanclass="pre">connect_via</span></code> method when
the Blinker library is not installed. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/3208">#3208</a></p></li>
<li><p>Add an <codeclass="docutils literal notranslate"><spanclass="pre">--extra-files</span></code> option to the <codeclass="docutils literal notranslate"><spanclass="pre">flask</span><spanclass="pre">run</span></code> CLI command to
specify extra files that will trigger the reloader on change.
<li><p>Allow returning a dictionary from a view function. Similar to how
returning a string will produce a <codeclass="docutils literal notranslate"><spanclass="pre">text/html</span></code> response, returning
a dict will call <codeclass="docutils literal notranslate"><spanclass="pre">jsonify</span></code> to produce a <codeclass="docutils literal notranslate"><spanclass="pre">application/json</span></code>
<li><p>Blueprints have a <codeclass="docutils literal notranslate"><spanclass="pre">cli</span></code> Click group like <codeclass="docutils literal notranslate"><spanclass="pre">app.cli</span></code>. CLI commands
registered with a blueprint will be available as a group under the
<li><p>When using the test client as a context manager (<codeclass="docutils literal notranslate"><spanclass="pre">with</span><spanclass="pre">client:</span></code>),
all preserved request contexts are popped when the block exits,
ensuring nested contexts are cleaned up correctly. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/3157">#3157</a></p></li>
<li><p>Show a better error message when the view return type is not
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">flask.testing.make_test_environ_builder()</span></code> has been deprecated in
favour of a new class <codeclass="docutils literal notranslate"><spanclass="pre">flask.testing.EnvironBuilder</span></code>. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/3232">#3232</a></p></li>
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">flask</span><spanclass="pre">run</span></code> command no longer fails if Python is not built
with SSL support. Using the <codeclass="docutils literal notranslate"><spanclass="pre">--cert</span></code> option will show an
<h2>Version 1.0.4<aclass="headerlink"href="#version-1-0-4"title="Link to this heading">¶</a></h2>
<p>Released 2019-07-04</p>
<ulclass="simple">
<li><p>The key information for <codeclass="docutils literal notranslate"><spanclass="pre">BadRequestKeyError</span></code> is no longer cleared
outside debug mode, so error handlers can still access it. This
requires upgrading to Werkzeug 0.15.5. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/3249">#3249</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">send_file</span></code> url quotes the “:” and “/” characters for more
compatible UTF-8 filename support in some browsers. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/3074">#3074</a></p></li>
<li><p>Fixes for <spanclass="target"id="index-1"></span><aclass="pep reference external"href="https://peps.python.org/pep-0451/"><strong>PEP 451</strong></a> import loaders and pytest 5.x. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/3275">#3275</a></p></li>
<li><p>Show message about dotenv on stderr instead of stdout. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/3285">#3285</a></p></li>
</ul>
</section>
<sectionid="version-1-0-3">
<h2>Version 1.0.3<aclass="headerlink"href="#version-1-0-3"title="Link to this heading">¶</a></h2>
<p>Released 2019-05-17</p>
<ulclass="simple">
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">send_file</span></code> encodes filenames as ASCII instead of Latin-1
(ISO-8859-1). This fixes compatibility with Gunicorn, which is
stricter about header encodings than <spanclass="target"id="index-2"></span><aclass="pep reference external"href="https://peps.python.org/pep-3333/"><strong>PEP 3333</strong></a>. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/2766">#2766</a></p></li>
<li><p>Allow custom CLIs using <codeclass="docutils literal notranslate"><spanclass="pre">FlaskGroup</span></code> to set the debug flag without
it always being overwritten based on environment variables.
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">flask</span><spanclass="pre">--version</span></code> outputs Werkzeug’s version and simplifies the
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">send_file</span></code> handles an <codeclass="docutils literal notranslate"><spanclass="pre">attachment_filename</span></code> that is a native
<li><p>A catch-all error handler registered for <codeclass="docutils literal notranslate"><spanclass="pre">HTTPException</span></code> will not
handle <codeclass="docutils literal notranslate"><spanclass="pre">RoutingException</span></code>, which is used internally during
routing. This fixes the unexpected behavior that had been introduced
in 1.0. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2986">#2986</a></p></li>
<li><p>Passing the <codeclass="docutils literal notranslate"><spanclass="pre">json</span></code> argument to <codeclass="docutils literal notranslate"><spanclass="pre">app.test_client</span></code> does not
push/pop an extra app context. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/2900">#2900</a></p></li>
</ul>
</section>
<sectionid="version-1-0-2">
<h2>Version 1.0.2<aclass="headerlink"href="#version-1-0-2"title="Link to this heading">¶</a></h2>
<p>Released 2018-05-02</p>
<ulclass="simple">
<li><p>Fix more backwards compatibility issues with merging slashes between
a blueprint prefix and route. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2748">#2748</a></p></li>
<li><p>Fix error with <codeclass="docutils literal notranslate"><spanclass="pre">flask</span><spanclass="pre">routes</span></code> command when there are no routes.
<li><p>Don’t treat lists returned from view functions the same as tuples.
Only tuples are interpreted as response data. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/2736">#2736</a></p></li>
<li><p>Extra slashes between a blueprint’s <codeclass="docutils literal notranslate"><spanclass="pre">url_prefix</span></code> and a route URL
are merged. This fixes some backwards compatibility issues with the
change in 1.0. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/2731">#2731</a>, <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/2742">#2742</a></p></li>
<li><p>Only trap <codeclass="docutils literal notranslate"><spanclass="pre">BadRequestKeyError</span></code> errors in debug mode, not all
<codeclass="docutils literal notranslate"><spanclass="pre">BadRequest</span></code> errors. This allows <codeclass="docutils literal notranslate"><spanclass="pre">abort(400)</span></code> to continue
working as expected. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/2735">#2735</a></p></li>
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">FLASK_SKIP_DOTENV</span></code> environment variable can be set to <codeclass="docutils literal notranslate"><spanclass="pre">1</span></code>
to skip automatically loading dotenv files. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/2722">#2722</a></p></li>
</ul>
</section>
<sectionid="version-1-0">
<h2>Version 1.0<aclass="headerlink"href="#version-1-0"title="Link to this heading">¶</a></h2>
<p>Released 2018-04-26</p>
<ulclass="simple">
<li><p>Python 2.6 and 3.3 are no longer supported.</p></li>
<li><p>Bump minimum dependency versions to the latest stable versions:
<li><p>Skip <codeclass="docutils literal notranslate"><spanclass="pre">app.run</span></code> when a Flask application is run from the command
line. This avoids some behavior that was confusing to debug.</p></li>
<li><p>Change the default for <codeclass="docutils literal notranslate"><spanclass="pre">JSONIFY_PRETTYPRINT_REGULAR</span></code> to
<codeclass="docutils literal notranslate"><spanclass="pre">False</span></code>. <codeclass="docutils literal notranslate"><spanclass="pre">~json.jsonify</span></code> returns a compact format by default,
and an indented format in debug mode. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2193">#2193</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Flask.__init__</span></code> accepts the <codeclass="docutils literal notranslate"><spanclass="pre">host_matching</span></code> argument and sets
it on <codeclass="docutils literal notranslate"><spanclass="pre">Flask.url_map</span></code>. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/1559">#1559</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Flask.__init__</span></code> accepts the <codeclass="docutils literal notranslate"><spanclass="pre">static_host</span></code> argument and passes
it as the <codeclass="docutils literal notranslate"><spanclass="pre">host</span></code> argument when defining the static route.
<li><p>Pass <codeclass="docutils literal notranslate"><spanclass="pre">_scheme</span></code> argument from <codeclass="docutils literal notranslate"><spanclass="pre">url_for</span></code> to
<li><p>Errors caused while opening the session at the beginning of the
request are handled by the app’s error handlers. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2254">#2254</a></p></li>
<li><p>Blueprints gained <codeclass="docutils literal notranslate"><spanclass="pre">Blueprint.json_encoder</span></code> and
<codeclass="docutils literal notranslate"><spanclass="pre">Blueprint.json_decoder</span></code> attributes to override the app’s
encoder and decoder. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/1898">#1898</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Flask.make_response</span></code> raises <codeclass="docutils literal notranslate"><spanclass="pre">TypeError</span></code> instead of
<codeclass="docutils literal notranslate"><spanclass="pre">ValueError</span></code> for bad response types. The error messages have been
improved to describe why the type is invalid. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2256">#2256</a></p></li>
<li><p>Add <codeclass="docutils literal notranslate"><spanclass="pre">routes</span></code> CLI command to output routes registered on the
<li><p>Auto-detect zero-argument app factory called <codeclass="docutils literal notranslate"><spanclass="pre">create_app</span></code> or
<codeclass="docutils literal notranslate"><spanclass="pre">make_app</span></code> from <codeclass="docutils literal notranslate"><spanclass="pre">FLASK_APP</span></code>. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2297">#2297</a></p></li>
<li><p>Factory functions are not required to take a <codeclass="docutils literal notranslate"><spanclass="pre">script_info</span></code>
parameter to work with the <codeclass="docutils literal notranslate"><spanclass="pre">flask</span></code> command. If they take a single
parameter or a parameter named <codeclass="docutils literal notranslate"><spanclass="pre">script_info</span></code>, the <codeclass="docutils literal notranslate"><spanclass="pre">ScriptInfo</span></code>
object will be passed. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2319">#2319</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">FLASK_APP</span></code> can be set to an app factory, with arguments if
needed, for example <codeclass="docutils literal notranslate"><spanclass="pre">FLASK_APP=myproject.app:create_app('dev')</span></code>.
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">FLASK_APP</span></code> can point to local packages that are not installed in
editable mode, although <codeclass="docutils literal notranslate"><spanclass="pre">pip</span><spanclass="pre">install</span><spanclass="pre">-e</span></code> is still preferred.
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">View</span></code> class attribute
<codeclass="docutils literal notranslate"><spanclass="pre">View.provide_automatic_options</span></code> is set in <codeclass="docutils literal notranslate"><spanclass="pre">View.as_view</span></code>, to be
detected by <codeclass="docutils literal notranslate"><spanclass="pre">Flask.add_url_rule</span></code>. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2316">#2316</a></p></li>
<li><p>Error handling will try handlers registered for <codeclass="docutils literal notranslate"><spanclass="pre">blueprint,</span><spanclass="pre">code</span></code>,
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Cookie</span></code> is added to the response’s <codeclass="docutils literal notranslate"><spanclass="pre">Vary</span></code> header if the session
is accessed at all during the request (and not deleted). <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2288">#2288</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Flask.test_request_context</span></code> accepts <codeclass="docutils literal notranslate"><spanclass="pre">subdomain</span></code> and
<codeclass="docutils literal notranslate"><spanclass="pre">url_scheme</span></code> arguments for use when building the base URL.
<li><p>Set <codeclass="docutils literal notranslate"><spanclass="pre">APPLICATION_ROOT</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">'/'</span></code> by default. This was already the
implicit default when it was set to <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">TRAP_BAD_REQUEST_ERRORS</span></code> is enabled by default in debug mode.
<codeclass="docutils literal notranslate"><spanclass="pre">BadRequestKeyError</span></code> has a message with the bad key in debug mode
instead of the generic bad request message. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2348">#2348</a></p></li>
<li><p>Allow registering new tags with <codeclass="docutils literal notranslate"><spanclass="pre">TaggedJSONSerializer</span></code> to support
storing other types in the session cookie. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2352">#2352</a></p></li>
<li><p>Only open the session if the request has not been pushed onto the
context stack yet. This allows <codeclass="docutils literal notranslate"><spanclass="pre">stream_with_context</span></code> generators to
access the same session that the containing view uses. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2354">#2354</a></p></li>
<li><p>Add <codeclass="docutils literal notranslate"><spanclass="pre">json</span></code> keyword argument for the test client request methods.
This will dump the given object as JSON and set the appropriate
<li><p>Extract JSON handling to a mixin applied to both the <codeclass="docutils literal notranslate"><spanclass="pre">Request</span></code> and
<codeclass="docutils literal notranslate"><spanclass="pre">Response</span></code> classes. This adds the <codeclass="docutils literal notranslate"><spanclass="pre">Response.is_json</span></code> and
<codeclass="docutils literal notranslate"><spanclass="pre">Response.get_json</span></code> methods to the response to make testing JSON
response much easier. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2358">#2358</a></p></li>
<li><p>Removed error handler caching because it caused unexpected results
for some exception inheritance hierarchies. Register handlers
explicitly for each exception if you want to avoid traversing the
<li><p>Template auto reloading will honor debug mode even if
<codeclass="docutils literal notranslate"><spanclass="pre">Flask.jinja_env</span></code> was already accessed. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2373">#2373</a></p></li>
<li><p>The following old deprecated code was removed. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/2385">#2385</a></p>
<ul>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">flask.ext</span></code> - import extensions directly by their name instead
of through the <codeclass="docutils literal notranslate"><spanclass="pre">flask.ext</span></code> namespace. For example,
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Flask.static_path</span></code> - use <codeclass="docutils literal notranslate"><spanclass="pre">Flask.static_url_path</span></code> instead.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Request.module</span></code> - use <codeclass="docutils literal notranslate"><spanclass="pre">Request.blueprint</span></code> instead.</p></li>
</ul>
</li>
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">Request.json</span></code> property is no longer deprecated. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/1421">#1421</a></p></li>
<li><p>Support passing a <codeclass="docutils literal notranslate"><spanclass="pre">EnvironBuilder</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">dict</span></code> to
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">flask</span></code> command and <codeclass="docutils literal notranslate"><spanclass="pre">Flask.run</span></code> will load environment
variables from <codeclass="docutils literal notranslate"><spanclass="pre">.env</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">.flaskenv</span></code> files if python-dotenv is
<li><p>When passing a full URL to the test client, the scheme in the URL is
used instead of <codeclass="docutils literal notranslate"><spanclass="pre">PREFERRED_URL_SCHEME</span></code>. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2430">#2430</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Flask.logger</span></code> has been simplified. <codeclass="docutils literal notranslate"><spanclass="pre">LOGGER_NAME</span></code> and
<codeclass="docutils literal notranslate"><spanclass="pre">LOGGER_HANDLER_POLICY</span></code> config was removed. The logger is always
named <codeclass="docutils literal notranslate"><spanclass="pre">flask.app</span></code>. The level is only set on first access, it
doesn’t check <codeclass="docutils literal notranslate"><spanclass="pre">Flask.debug</span></code> each time. Only one format is used,
not different ones depending on <codeclass="docutils literal notranslate"><spanclass="pre">Flask.debug</span></code>. No handlers are
removed, and a handler is only added if no handlers are already
<li><p>Blueprint view function names may not contain dots. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2450">#2450</a></p></li>
<li><p>Fix a <codeclass="docutils literal notranslate"><spanclass="pre">ValueError</span></code> caused by invalid <codeclass="docutils literal notranslate"><spanclass="pre">Range</span></code> requests in some
<li><p>The development server uses threads by default. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2529">#2529</a></p></li>
<li><p>Loading config files with <codeclass="docutils literal notranslate"><spanclass="pre">silent=True</span></code> will ignore <codeclass="docutils literal notranslate"><spanclass="pre">ENOTDIR</span></code>
<li><p>Pass <codeclass="docutils literal notranslate"><spanclass="pre">--cert</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">--key</span></code> options to <codeclass="docutils literal notranslate"><spanclass="pre">flask</span><spanclass="pre">run</span></code> to run the
development server over HTTPS. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2606">#2606</a></p></li>
<li><p>Added <codeclass="docutils literal notranslate"><spanclass="pre">SESSION_COOKIE_SAMESITE</span></code> to control the <codeclass="docutils literal notranslate"><spanclass="pre">SameSite</span></code>
attribute on the session cookie. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2607">#2607</a></p></li>
<li><p>Added <codeclass="docutils literal notranslate"><spanclass="pre">Flask.test_cli_runner</span></code> to create a Click runner that can
invoke Flask CLI commands for testing. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2636">#2636</a></p></li>
<li><p>Subdomain matching is disabled by default and setting
<codeclass="docutils literal notranslate"><spanclass="pre">SERVER_NAME</span></code> does not implicitly enable it. It can be enabled by
passing <codeclass="docutils literal notranslate"><spanclass="pre">subdomain_matching=True</span></code> to the <codeclass="docutils literal notranslate"><spanclass="pre">Flask</span></code> constructor.
<li><p>A single trailing slash is stripped from the blueprint
<codeclass="docutils literal notranslate"><spanclass="pre">url_prefix</span></code> when it is registered with the app. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2629">#2629</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Request.get_json</span></code> doesn’t cache the result if parsing fails when
<codeclass="docutils literal notranslate"><spanclass="pre">silent</span></code> is true. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/2651">#2651</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Request.get_json</span></code> no longer accepts arbitrary encodings. Incoming
JSON should be encoded using UTF-8 per <spanclass="target"id="index-3"></span><aclass="rfc reference external"href="https://datatracker.ietf.org/doc/html/rfc8259.html"><strong>RFC 8259</strong></a>, but Flask will
autodetect UTF-8, -16, or -32. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2691">#2691</a></p></li>
<li><p>Added <codeclass="docutils literal notranslate"><spanclass="pre">MAX_COOKIE_SIZE</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">Response.max_cookie_size</span></code> to
control when Werkzeug warns about large cookies that browsers may
<h2>Version 0.12.5<aclass="headerlink"href="#version-0-12-5"title="Link to this heading">¶</a></h2>
<p>Released 2020-02-10</p>
<ulclass="simple">
<li><p>Pin Werkzeug to < 1.0.0. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/3497">#3497</a></p></li>
</ul>
</section>
<sectionid="version-0-12-4">
<h2>Version 0.12.4<aclass="headerlink"href="#version-0-12-4"title="Link to this heading">¶</a></h2>
<p>Released 2018-04-29</p>
<ulclass="simple">
<li><p>Repackage 0.12.3 to fix package layout issue. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/2728">#2728</a></p></li>
</ul>
</section>
<sectionid="version-0-12-3">
<h2>Version 0.12.3<aclass="headerlink"href="#version-0-12-3"title="Link to this heading">¶</a></h2>
<p>Released 2018-04-26</p>
<ulclass="simple">
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Request.get_json</span></code> no longer accepts arbitrary encodings.
Incoming JSON should be encoded using UTF-8 per <spanclass="target"id="index-4"></span><aclass="rfc reference external"href="https://datatracker.ietf.org/doc/html/rfc8259.html"><strong>RFC 8259</strong></a>, but
Flask will autodetect UTF-8, -16, or -32. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/2692">#2692</a></p></li>
<li><p>Fix a Python warning about imports when using <codeclass="docutils literal notranslate"><spanclass="pre">python</span><spanclass="pre">-m</span><spanclass="pre">flask</span></code>.
<li><p>Fix a <codeclass="docutils literal notranslate"><spanclass="pre">ValueError</span></code> caused by invalid <codeclass="docutils literal notranslate"><spanclass="pre">Range</span></code> requests in some
cases.</p></li>
</ul>
</section>
<sectionid="version-0-12-2">
<h2>Version 0.12.2<aclass="headerlink"href="#version-0-12-2"title="Link to this heading">¶</a></h2>
<p>Released 2017-05-16</p>
<ulclass="simple">
<li><p>Fix a bug in <codeclass="docutils literal notranslate"><spanclass="pre">safe_join</span></code> on Windows.</p></li>
</ul>
</section>
<sectionid="version-0-12-1">
<h2>Version 0.12.1<aclass="headerlink"href="#version-0-12-1"title="Link to this heading">¶</a></h2>
<p>Released 2017-03-31</p>
<ulclass="simple">
<li><p>Prevent <codeclass="docutils literal notranslate"><spanclass="pre">flask</span><spanclass="pre">run</span></code> from showing a <codeclass="docutils literal notranslate"><spanclass="pre">NoAppException</span></code> when an
<codeclass="docutils literal notranslate"><spanclass="pre">ImportError</span></code> occurs within the imported application module.</p></li>
<li><p>Fix encoding behavior of <codeclass="docutils literal notranslate"><spanclass="pre">app.config.from_pyfile</span></code> for Python 3.
<li><p>Use the <codeclass="docutils literal notranslate"><spanclass="pre">SERVER_NAME</span></code> config if it is present as default values
for <codeclass="docutils literal notranslate"><spanclass="pre">app.run</span></code>. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/2109">#2109</a>, <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/2152">#2152</a></p></li>
<li><p>Call <codeclass="docutils literal notranslate"><spanclass="pre">ctx.auto_pop</span></code> with the exception object instead of <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>,
in the event that a <codeclass="docutils literal notranslate"><spanclass="pre">BaseException</span></code> such as <codeclass="docutils literal notranslate"><spanclass="pre">KeyboardInterrupt</span></code>
is raised in a request handler.</p></li>
</ul>
</section>
<sectionid="version-0-12">
<h2>Version 0.12<aclass="headerlink"href="#version-0-12"title="Link to this heading">¶</a></h2>
<p>Released 2016-12-21, codename Punsch</p>
<ulclass="simple">
<li><p>The cli command now responds to <codeclass="docutils literal notranslate"><spanclass="pre">--version</span></code>.</p></li>
<li><p>Mimetype guessing and ETag generation for file-like objects in
<codeclass="docutils literal notranslate"><spanclass="pre">send_file</span></code> has been removed. <aclass="extlink-issue reference external"href="https://github.com/pallets/flask/issues/104">#104</a>, :pr`1849`</p></li>
<li><p>Mimetype guessing in <codeclass="docutils literal notranslate"><spanclass="pre">send_file</span></code> now fails loudly and doesn’t fall
back to <codeclass="docutils literal notranslate"><spanclass="pre">application/octet-stream</span></code>. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/1988">#1988</a></p></li>
<li><p>Make <codeclass="docutils literal notranslate"><spanclass="pre">flask.safe_join</span></code> able to join multiple paths like
<li><p>Added <codeclass="docutils literal notranslate"><spanclass="pre">**kwargs</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">Flask.test_client</span></code> to support passing
additional keyword arguments to the constructor of
<li><p>Templates are no longer automatically reloaded outside of debug
mode. This can be configured with the new <codeclass="docutils literal notranslate"><spanclass="pre">TEMPLATES_AUTO_RELOAD</span></code>
config key.</p></li>
<li><p>Added a workaround for a limitation in Python 3.3’s namespace
loader.</p></li>
<li><p>Added support for explicit root paths when using Python 3.3’s
namespace packages.</p></li>
<li><p>Added <codeclass="docutils literal notranslate"><spanclass="pre">flask</span></code> and the <codeclass="docutils literal notranslate"><spanclass="pre">flask.cli</span></code> module to start the
local debug server through the click CLI system. This is recommended
over the old <codeclass="docutils literal notranslate"><spanclass="pre">flask.run()</span></code> method as it works faster and more
reliable due to a different design and also replaces
<li><p>Added the <codeclass="docutils literal notranslate"><spanclass="pre">EXPLAIN_TEMPLATE_LOADING</span></code> config flag which when
enabled will instruct Flask to explain how it locates templates.
This should help users debug when the wrong templates are loaded.</p></li>
<li><p>Enforce blueprint handling in the order they were registered for
template loading.</p></li>
<li><p>Ported test suite to py.test.</p></li>
<li><p>Deprecated <codeclass="docutils literal notranslate"><spanclass="pre">request.json</span></code> in favour of <codeclass="docutils literal notranslate"><spanclass="pre">request.get_json()</span></code>.</p></li>
<li><p>Add “pretty” and “compressed” separators definitions in jsonify()
method. Reduces JSON response size when
<codeclass="docutils literal notranslate"><spanclass="pre">JSONIFY_PRETTYPRINT_REGULAR=False</span></code> by removing unnecessary white
space included by default after separators.</p></li>
<li><p>JSON responses are now terminated with a newline character, because
it is a convention that UNIX text files end with a newline and some
clients don’t deal well when this newline is missing. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/1262">#1262</a></p></li>
<li><p>The automatically provided <codeclass="docutils literal notranslate"><spanclass="pre">OPTIONS</span></code> method is now correctly
disabled if the user registered an overriding rule with the
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">flask.json.jsonify</span></code> now supports the <codeclass="docutils literal notranslate"><spanclass="pre">datetime.date</span></code> type.
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">flask.g</span></code> now has <codeclass="docutils literal notranslate"><spanclass="pre">pop()</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">setdefault</span></code> methods.</p></li>
<li><p>Turn on autoescape for <codeclass="docutils literal notranslate"><spanclass="pre">flask.templating.render_template_string</span></code>
by default. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/1515">#1515</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">flask.ext</span></code> is now deprecated. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/1484">#1484</a></p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">send_from_directory</span></code> now raises BadRequest if the filename is
invalid on the server OS. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/1763">#1763</a></p></li>
<li><p>Added the <codeclass="docutils literal notranslate"><spanclass="pre">JSONIFY_MIMETYPE</span></code> configuration variable. <aclass="extlink-pr reference external"href="https://github.com/pallets/flask/pull/1728">#1728</a></p></li>
<li><p>Exceptions during teardown handling will no longer leave bad
application contexts lingering around.</p></li>
<li><p>Fixed broken <codeclass="docutils literal notranslate"><spanclass="pre">test_appcontext_signals()</span></code> test case.</p></li>
<li><p>Raise an <codeclass="docutils literal notranslate"><spanclass="pre">AttributeError</span></code> in <codeclass="docutils literal notranslate"><spanclass="pre">helpers.find_package</span></code> with a
useful message explaining why it is raised when a <spanclass="target"id="index-5"></span><aclass="pep reference external"href="https://peps.python.org/pep-0302/"><strong>PEP 302</strong></a> import
hook is used without an <codeclass="docutils literal notranslate"><spanclass="pre">is_package()</span></code> method.</p></li>
<li><p>Fixed an issue causing exceptions raised before entering a request
or app context to be passed to teardown handlers.</p></li>
<li><p>Fixed an issue with query parameters getting removed from requests
in the test client when absolute URLs were requested.</p></li>
<li><p>Made <codeclass="docutils literal notranslate"><spanclass="pre">@before_first_request</span></code> into a decorator as intended.</p></li>
<li><p>Fixed an etags bug when sending a file streams with a name.</p></li>
<li><p>Fixed <codeclass="docutils literal notranslate"><spanclass="pre">send_from_directory</span></code> not expanding to the application root
path correctly.</p></li>
<li><p>Changed logic of before first request handlers to flip the flag
after invoking. This will allow some uses that are potentially
dangerous but should probably be permitted.</p></li>
<li><p>Fixed Python 3 bug when a handler from
<codeclass="docutils literal notranslate"><spanclass="pre">app.url_build_error_handlers</span></code> reraises the <codeclass="docutils literal notranslate"><spanclass="pre">BuildError</span></code>.</p></li>
</ul>
</section>
<sectionid="version-0-10-1">
<h2>Version 0.10.1<aclass="headerlink"href="#version-0-10-1"title="Link to this heading">¶</a></h2>
<p>Released 2013-06-14</p>
<ulclass="simple">
<li><p>Fixed an issue where <codeclass="docutils literal notranslate"><spanclass="pre">|tojson</span></code> was not quoting single quotes which
made the filter not work properly in HTML attributes. Now it’s
possible to use that filter in single quoted attributes. This should
make using that filter with angular.js easier.</p></li>
<li><p>Added support for byte strings back to the session system. This
broke compatibility with the common case of people putting binary
data for token verification into the session.</p></li>
<li><p>Fixed an issue where registering the same method twice for the same
endpoint would trigger an exception incorrectly.</p></li>
</ul>
</section>
<sectionid="version-0-10">
<h2>Version 0.10<aclass="headerlink"href="#version-0-10"title="Link to this heading">¶</a></h2>
<p>Released 2013-06-13, codename Limoncello</p>
<ulclass="simple">
<li><p>Changed default cookie serialization format from pickle to JSON to
limit the impact an attacker can do if the secret key leaks.</p></li>
<li><p>Added <codeclass="docutils literal notranslate"><spanclass="pre">template_test</span></code> methods in addition to the already existing
<li><p>Set the content-length header for x-sendfile.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">tojson</span></code> filter now does not escape script blocks in HTML5
parsers.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">tojson</span></code> used in templates is now safe by default. This was
allowed due to the different escaping behavior.</p></li>
<li><p>Flask will now raise an error if you attempt to register a new
function on an already used endpoint.</p></li>
<li><p>Added wrapper module around simplejson and added default
serialization of datetime objects. This allows much easier
customization of how JSON is handled by Flask or any Flask
extension.</p></li>
<li><p>Removed deprecated internal <codeclass="docutils literal notranslate"><spanclass="pre">flask.session</span></code> module alias. Use
<codeclass="docutils literal notranslate"><spanclass="pre">flask.sessions</span></code> instead to get the session module. This is not to
be confused with <codeclass="docutils literal notranslate"><spanclass="pre">flask.session</span></code> the session proxy.</p></li>
<li><p>Templates can now be rendered without request context. The behavior
is slightly different as the <codeclass="docutils literal notranslate"><spanclass="pre">request</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">session</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">g</span></code>
objects will not be available and blueprint’s context processors are
not called.</p></li>
<li><p>The config object is now available to the template as a real global
and not through a context processor which makes it available even in
imported templates by default.</p></li>
<li><p>Added an option to generate non-ascii encoded JSON which should
result in less bytes being transmitted over the network. It’s
disabled by default to not cause confusion with existing libraries
that might expect <codeclass="docutils literal notranslate"><spanclass="pre">flask.json.dumps</span></code> to return bytes by default.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">flask.g</span></code> is now stored on the app context instead of the request
context.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">flask.g</span></code> now gained a <codeclass="docutils literal notranslate"><spanclass="pre">get()</span></code> method for not erroring out on
non existing items.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">flask.g</span></code> now can be used with the <codeclass="docutils literal notranslate"><spanclass="pre">in</span></code> operator to see what’s
defined and it now is iterable and will yield all attributes stored.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">flask.Flask.request_globals_class</span></code> got renamed to
<codeclass="docutils literal notranslate"><spanclass="pre">flask.Flask.app_ctx_globals_class</span></code> which is a better name to what
it does since 0.10.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">request</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">session</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">g</span></code> are now also added as proxies to
the template context which makes them available in imported
templates. One has to be very careful with those though because
usage outside of macros might cause caching.</p></li>
<li><p>Flask will no longer invoke the wrong error handlers if a proxy
exception is passed through.</p></li>
<li><p>Added a workaround for chrome’s cookies in localhost not working as
intended with domain names.</p></li>
<li><p>Changed logic for picking defaults for cookie values from sessions
to work better with Google Chrome.</p></li>
<li><p>Added <codeclass="docutils literal notranslate"><spanclass="pre">message_flashed</span></code> signal that simplifies flashing testing.</p></li>
<li><p>Added support for copying of request contexts for better working
with greenlets.</p></li>
<li><p>Removed custom JSON HTTP exception subclasses. If you were relying
on them you can reintroduce them again yourself trivially. Using
them however is strongly discouraged as the interface was flawed.</p></li>
<li><p>Python requirements changed: requiring Python 2.6 or 2.7 now to
prepare for Python 3.3 port.</p></li>
<li><p>Changed how the teardown system is informed about exceptions. This
is now more reliable in case something handles an exception halfway
through the error handling process.</p></li>
<li><p>Request context preservation in debug mode now keeps the exception
information around which means that teardown handlers are able to
distinguish error from success cases.</p></li>
<li><p>Added the <codeclass="docutils literal notranslate"><spanclass="pre">JSONIFY_PRETTYPRINT_REGULAR</span></code> configuration variable.</p></li>
<li><p>Flask now orders JSON keys by default to not trash HTTP caches due
to different hash seeds between different workers.</p></li>
<li><p>Added <codeclass="docutils literal notranslate"><spanclass="pre">appcontext_pushed</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">appcontext_popped</span></code> signals.</p></li>
<li><p>The builtin run method now takes the <codeclass="docutils literal notranslate"><spanclass="pre">SERVER_NAME</span></code> into account
when picking the default port to run on.</p></li>
<li><p>Added <codeclass="docutils literal notranslate"><spanclass="pre">flask.request.get_json()</span></code> as a replacement for the old
<h2>Version 0.9<aclass="headerlink"href="#version-0-9"title="Link to this heading">¶</a></h2>
<p>Released 2012-07-01, codename Campari</p>
<ulclass="simple">
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">Request.on_json_loading_failed</span></code> now returns a JSON formatted
response by default.</p></li>
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">url_for</span></code> function now can generate anchors to the generated
links.</p></li>
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">url_for</span></code> function now can also explicitly generate URL rules
specific to a given HTTP method.</p></li>
<li><p>Logger now only returns the debug log setting if it was not set
explicitly.</p></li>
<li><p>Unregister a circular dependency between the WSGI environment and
the request object when shutting down the request. This means that
environ <codeclass="docutils literal notranslate"><spanclass="pre">werkzeug.request</span></code> will be <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code> after the response was
returned to the WSGI server but has the advantage that the garbage
collector is not needed on CPython to tear down the request unless
the user created circular dependencies themselves.</p></li>
<li><p>Session is now stored after callbacks so that if the session payload
is stored in the session you can still modify it in an after request
callback.</p></li>
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">Flask</span></code> class will avoid importing the provided import name if
it can (the required first parameter), to benefit tools which build
Flask instances programmatically. The Flask class will fall back to
using import on systems with custom module hooks, e.g. Google App
Engine, or when the import name is inside a zip archive (usually an
egg) prior to Python 2.7.</p></li>
<li><p>Blueprints now have a decorator to add custom template filters
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">get_flashed_messages</span></code> function now allows rendering flashed
message categories in separate blocks, through a <codeclass="docutils literal notranslate"><spanclass="pre">category_filter</span></code>
argument.</p></li>
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">Flask.run</span></code> method now accepts <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code> for <codeclass="docutils literal notranslate"><spanclass="pre">host</span></code> and
<codeclass="docutils literal notranslate"><spanclass="pre">port</span></code> arguments, using default values when <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>. This allows
with proper behavior whether or not a config file is provided.</p></li>
<li><p>The <codeclass="docutils literal notranslate"><spanclass="pre">render_template</span></code> method now accepts a either an iterable of
template names or a single template name. Previously, it only
accepted a single template name. On an iterable, the first template
found is rendered.</p></li>
<li><p>Added <codeclass="docutils literal notranslate"><spanclass="pre">Flask.app_context</span></code> which works very similar to the request
context but only provides access to the current application. This
also adds support for URL generation without an active request
context.</p></li>
<li><p>View functions can now return a tuple with the first instance being
an instance of <codeclass="docutils literal notranslate"><spanclass="pre">Response</span></code>. This allows for returning
<codeclass="docutils literal notranslate"><spanclass="pre">jsonify(error="error</span><spanclass="pre">msg"),</span><spanclass="pre">400</span></code> from a view function.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Flask</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">Blueprint</span></code> now provide a <codeclass="docutils literal notranslate"><spanclass="pre">get_send_file_max_age</span></code>
hook for subclasses to override behavior of serving static files
from Flask when using <codeclass="docutils literal notranslate"><spanclass="pre">Flask.send_static_file</span></code> (used for the
default static file handler) and <codeclass="docutils literal notranslate"><spanclass="pre">helpers.send_file</span></code>. This hook is
provided a filename, which for example allows changing cache
controls by file extension. The default max-age for <codeclass="docutils literal notranslate"><spanclass="pre">send_file</span></code>
and static files can be configured through a new
<codeclass="docutils literal notranslate"><spanclass="pre">SEND_FILE_MAX_AGE_DEFAULT</span></code> configuration variable, which is used
in the default <codeclass="docutils literal notranslate"><spanclass="pre">get_send_file_max_age</span></code> implementation.</p></li>
<li><p>Fixed an assumption in sessions implementation which could break
message flashing on sessions implementations which use external
storage.</p></li>
<li><p>Changed the behavior of tuple return values from functions. They are
no longer arguments to the response object, they now have a defined
meaning.</p></li>
<li><p>Added <codeclass="docutils literal notranslate"><spanclass="pre">Flask.request_globals_class</span></code> to allow a specific class to
be used on creation of the <codeclass="docutils literal notranslate"><spanclass="pre">g</span></code> instance of each request.</p></li>
<li><p>Added <codeclass="docutils literal notranslate"><spanclass="pre">required_methods</span></code> attribute to view functions to force-add
<li><p>Mimetype guessing and etag support based on file objects is now
deprecated for <codeclass="docutils literal notranslate"><spanclass="pre">send_file</span></code> because it was unreliable. Pass
filenames instead or attach your own etags and provide a proper
mimetype by hand.</p></li>
<li><p>Static file handling for modules now requires the name of the static
folder to be supplied explicitly. The previous autodetection was not
reliable and caused issues on Google’s App Engine. Until 1.0 the old
behavior will continue to work but issue dependency warnings.</p></li>
<li><p>Fixed a problem for Flask to run on jython.</p></li>
<li><p>Added a <codeclass="docutils literal notranslate"><spanclass="pre">PROPAGATE_EXCEPTIONS</span></code> configuration variable that can be
used to flip the setting of exception propagation which previously
was linked to <codeclass="docutils literal notranslate"><spanclass="pre">DEBUG</span></code> alone and is now linked to either <codeclass="docutils literal notranslate"><spanclass="pre">DEBUG</span></code>
or <codeclass="docutils literal notranslate"><spanclass="pre">TESTING</span></code>.</p></li>
<li><p>Flask no longer internally depends on rules being added through the
<codeclass="docutils literal notranslate"><spanclass="pre">add_url_rule</span></code> function and can now also accept regular werkzeug
rules added to the url map.</p></li>
<li><p>Added an <codeclass="docutils literal notranslate"><spanclass="pre">endpoint</span></code> method to the flask application object which
allows one to register a callback to an arbitrary endpoint with a
decorator.</p></li>
<li><p>Use Last-Modified for static file sending instead of Date which was
incorrectly introduced in 0.6.</p></li>
<li><p>Added <codeclass="docutils literal notranslate"><spanclass="pre">create_jinja_loader</span></code> to override the loader creation
process.</p></li>
<li><p>Implemented a silent flag for <codeclass="docutils literal notranslate"><spanclass="pre">config.from_pyfile</span></code>.</p></li>
<li><p>Added <codeclass="docutils literal notranslate"><spanclass="pre">teardown_request</span></code> decorator, for functions that should run
at the end of a request regardless of whether an exception occurred.
Also the behavior for <codeclass="docutils literal notranslate"><spanclass="pre">after_request</span></code> was changed. It’s now no
longer executed when an exception is raised.</p></li>
<h2>Version 0.6.1<aclass="headerlink"href="#version-0-6-1"title="Link to this heading">¶</a></h2>
<p>Released 2010-12-31</p>
<ulclass="simple">
<li><p>Fixed an issue where the default <codeclass="docutils literal notranslate"><spanclass="pre">OPTIONS</span></code> response was not
exposing all valid methods in the <codeclass="docutils literal notranslate"><spanclass="pre">Allow</span></code> header.</p></li>
<li><p>Jinja2 template loading syntax now allows “./” in front of a
template load path. Previously this caused issues with module
setups.</p></li>
<li><p>Fixed an issue where the subdomain setting for modules was ignored
for the static folder.</p></li>
<li><p>Fixed a security problem that allowed clients to download arbitrary
files if the host server was a windows based operating system and
the client uses backslashes to escape the directory the files where
exposed from.</p></li>
</ul>
</section>
<sectionid="version-0-6">
<h2>Version 0.6<aclass="headerlink"href="#version-0-6"title="Link to this heading">¶</a></h2>
<p>Released 2010-07-27, codename Whisky</p>
<ulclass="simple">
<li><p>After request functions are now called in reverse order of
registration.</p></li>
<li><p>OPTIONS is now automatically implemented by Flask unless the
application explicitly adds ‘OPTIONS’ as method to the URL rule. In
this case no automatic OPTIONS handling kicks in.</p></li>
<li><p>Static rules are now even in place if there is no static folder for
the module. This was implemented to aid GAE which will remove the
static folder if it’s part of a mapping in the .yml file.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Flask.config</span></code> is now available in the templates as <codeclass="docutils literal notranslate"><spanclass="pre">config</span></code>.</p></li>
<li><p>Context processors will no longer override values passed directly to
the render function.</p></li>
<li><p>Added the ability to limit the incoming request data with the new
<li><p>The endpoint for the <codeclass="docutils literal notranslate"><spanclass="pre">Module.add_url_rule</span></code> method is now optional
to be consistent with the function of the same name on the
application object.</p></li>
<li><p>Added a <codeclass="docutils literal notranslate"><spanclass="pre">make_response</span></code> function that simplifies creating response
object instances in views.</p></li>
<li><p>Added signalling support based on blinker. This feature is currently
optional and supposed to be used by extensions and applications. If
you want to use it, make sure to have <codeclass="docutils literal notranslate"><spanclass="pre">blinker</span></code> installed.</p></li>
<li><p>Refactored the way URL adapters are created. This process is now
fully customizable with the <codeclass="docutils literal notranslate"><spanclass="pre">Flask.create_url_adapter</span></code> method.</p></li>
<li><p>Modules can now register for a subdomain instead of just an URL
prefix. This makes it possible to bind a whole module to a
configurable subdomain.</p></li>
</ul>
</section>
<sectionid="version-0-5-2">
<h2>Version 0.5.2<aclass="headerlink"href="#version-0-5-2"title="Link to this heading">¶</a></h2>
<p>Released 2010-07-15</p>
<ulclass="simple">
<li><p>Fixed another issue with loading templates from directories when
modules were used.</p></li>
</ul>
</section>
<sectionid="version-0-5-1">
<h2>Version 0.5.1<aclass="headerlink"href="#version-0-5-1"title="Link to this heading">¶</a></h2>
<p>Released 2010-07-06</p>
<ulclass="simple">
<li><p>Fixes an issue with template loading from directories when modules
where used.</p></li>
</ul>
</section>
<sectionid="version-0-5">
<h2>Version 0.5<aclass="headerlink"href="#version-0-5"title="Link to this heading">¶</a></h2>
<p>Released 2010-07-06, codename Calvados</p>
<ulclass="simple">
<li><p>Fixed a bug with subdomains that was caused by the inability to
specify the server name. The server name can now be set with the
<codeclass="docutils literal notranslate"><spanclass="pre">SERVER_NAME</span></code> config key. This key is now also used to set the
session cookie cross-subdomain wide.</p></li>
<li><p>Autoescaping is no longer active for all templates. Instead it is
only active for <codeclass="docutils literal notranslate"><spanclass="pre">.html</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">.htm</span></code>, <codeclass="docutils literal notranslate"><spanclass="pre">.xml</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">.xhtml</span></code>. Inside
templates this behavior can be changed with the <codeclass="docutils literal notranslate"><spanclass="pre">autoescape</span></code> tag.</p></li>
<li><p>Refactored Flask internally. It now consists of more than a single
file.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">send_file</span></code> now emits etags and has the ability to do conditional
responses builtin.</p></li>
<li><p>(temporarily) dropped support for zipped applications. This was a
rarely used feature and led to some confusing behavior.</p></li>
<li><p>Added support for per-package template and static-file directories.</p></li>
<li><p>Removed support for <codeclass="docutils literal notranslate"><spanclass="pre">create_jinja_loader</span></code> which is no longer used
in 0.5 due to the improved module support.</p></li>
<li><p>Added a helper function to expose files from any directory.</p></li>
</ul>
</section>
<sectionid="version-0-4">
<h2>Version 0.4<aclass="headerlink"href="#version-0-4"title="Link to this heading">¶</a></h2>
<p>Released 2010-06-18, codename Rakia</p>
<ulclass="simple">
<li><p>Added the ability to register application wide error handlers from
modules.</p></li>
<li><p><codeclass="docutils literal notranslate"><spanclass="pre">Flask.after_request</span></code> handlers are now also invoked if the request
dies with an exception and an error handling page kicks in.</p></li>
<li><p>Test client has not the ability to preserve the request context for
a little longer. This can also be used to trigger custom requests
that do not pop the request stack for testing.</p></li>
<li><p>Because the Python standard library caches loggers, the name of the
logger is configurable now to better support unittests.</p></li>
<li><p>Added <codeclass="docutils literal notranslate"><spanclass="pre">TESTING</span></code> switch that can activate unittesting helpers.</p></li>
<li><p>The logger switches to <codeclass="docutils literal notranslate"><spanclass="pre">DEBUG</span></code> mode now if debug is enabled.</p></li>
</ul>
</section>
<sectionid="version-0-3-1">
<h2>Version 0.3.1<aclass="headerlink"href="#version-0-3-1"title="Link to this heading">¶</a></h2>
<p>Released 2010-05-28</p>
<ulclass="simple">
<li><p>Fixed a error reporting bug with <codeclass="docutils literal notranslate"><spanclass="pre">Config.from_envvar</span></code>.</p></li>
<li><p>Removed some unused code.</p></li>
<li><p>Release does no longer include development leftover files (.git
folder for themes, built documentation in zip and pdf file and some
.pyc files)</p></li>
</ul>
</section>
<sectionid="version-0-3">
<h2>Version 0.3<aclass="headerlink"href="#version-0-3"title="Link to this heading">¶</a></h2>
<p>Released 2010-05-28, codename Schnaps</p>
<ulclass="simple">
<li><p>Added support for categories for flashed messages.</p></li>
<li><p>The application now configures a <codeclass="docutils literal notranslate"><spanclass="pre">logging.Handler</span></code> and will log
request handling exceptions to that logger when not in debug mode.
This makes it possible to receive mails on server errors for
example.</p></li>
<li><p>Added support for context binding that does not require the use of
the with statement for playing in the console.</p></li>
<li><p>The request context is now available within the with statement
making it possible to further push the request context or pop it.</p></li>
<li><p>Added support for configurations.</p></li>
</ul>
</section>
<sectionid="version-0-2">
<h2>Version 0.2<aclass="headerlink"href="#version-0-2"title="Link to this heading">¶</a></h2>