After a very long, long waiting time Flask finally got a new release. There really was no good reason that there has not been a release in such a long time but unfortunately once things are postponed for too long a certain release anxiety kicks in.
In this case this was long tagged as 1.0 but we decided for renaming it to 0.11 and back out some of the more controversial changes. In particular the new command line interface for Flask was modified a bit to not depend on some specific functionality in the supporting Click library.
Highlights of this release are the improved development experience which now stalls the browser on reload instead of bringing up a "connection reset" page and the new command line support.
This is also the first Flask release under the new pallets organization and from now on we hope to bring you releases more frequently. Ideally with the next release we also update the website to find a new home for the showcase, flask extension list as well as the snippet section to allow the community to take care of those things themselves.
- Added support to serializing top-level arrays to
flask.jsonify. This introduces a security risk in ancient browsers. See json-security for details.
flask.Test.test_clientto support passing additional keyword arguments to the constructor of flask.Flask.test_client_class.
SESSION_REFRESH_EACH_REQUESTconfig key that controls the set-cookie behavior. If set to
Truea permanent session will be refreshed each request and get their lifetime extended, if set to
Falseit will only be modified if the session actually modifies. Non permanent sessions are not affected by this and will always expire if the browser window closes.
- Made Flask support custom JSON mimetypes for incoming data.
- Added support for returning tuples in the form
(response, headers)from a view function.
- Templates are no longer automatically reloaded outside of debug mode. This can be configured with the new
- Added a workaround for a limitation in Python 3.3's namespace loader.
- Added support for explicit root paths when using Python 3.3's namespace packages.
- Added the
flaskcommand and the
flask.climodule to start the local debug server through the click CLI system. This is recommended over the old
flask.run()method as it works faster and more reliable due to a different design and also replaces
- Error handlers that match specific classes are now checked first, thereby allowing catching exceptions that are subclasses of HTTP exceptions (in
werkzeug.exceptions). This makes it possible for an extension author to create exceptions that will by default result in the HTTP error of their choosing, but may be caught with a custom error handler if desired.
- Flask will now log by default even if debug is disabled. The log format is now hardcoded but the default log handling can be disabled through the
- Removed deprecated module functionality.
- Added the
EXPLAIN_TEMPLATE_LOADINGconfig flag which when enabled will instruct Flask to explain how it locates templates. This should help users debug when the wrong templates are loaded.
- Enforce blueprint handling in the order they were registered for template loading.
- Ported test suite to py.test.
request.jsonin favour of
- Add "pretty" and "compressed" separators definitions in
jsonify()method. Reduces JSON response size when
JSONIFY_PRETTYPRINT_REGULAR=Falseby removing unnecessary white space included by default after separators.
- 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. See https://github.com/pallets/flask/pull/1262 -- this came up originally as a part of https://github.com/kennethreitz/httpbin/issues/168
- The automatically provided
OPTIONSmethod is now correctly disabled if the user registered an overriding rule with the lowercase-version
flask.json.jsonifynow supports the
datetime.datetype (pull request
- Don't leak exception info of already caught exceptions to context teardown handlers (pull request
- Allow custom Jinja environment subclasses (pull request
- Turn on autoescape for
flask.templating.render_template_stringby default (pull request
flask.extis now deprecated (pull request
send_from_directorynow raises BadRequest if the filename is invalid on the server OS (pull request
- Added the
JSONIFY_MIMETYPEconfiguration variable (pull request
- Exceptions during teardown handling will no longer leave bad application contexts lingering around.