ANN: Flask 0.8 and Werkzeug 0.8 Released
Two days too late but I wanted to make sure I got that upgrade for Flask
extensions sorted out. Flask 0.8 Codename Rakija and Werkzeug 0.8
Codename Lötkolben are now released.
New in Flask:
- Refactored session support into a session interface so that
the implementation of the sessions can be changed without
having to override the Flask class.
- Empty session cookies are now deleted properly automatically.
- View functions can now opt out of getting the automatic
- HTTP exceptions and Bad Request errors can now be trapped so that they
show up normally in the traceback.
- Flask in debug mode is now detecting some common problems and tries to
warn you about them.
- Flask in debug mode will now complain with an assertion error if a
view was attached after the first request was handled. This gives
earlier feedback when users forget to import view code ahead of time.
- Added the ability to register callbacks that are only triggered once
at the beginning of the first request.
- Malformed JSON data will now trigger a bad request HTTP exception
instead of a value error which usually would result in a 500 internal
server error if not handled. This is a backwards incompatible change.
- Applications now not only have a root path where the resources and
modules are located but also an instane path which is the designated
place to drop files that are modified at runtime (uploads etc.).
Also this is conceptionally only instance depending and outside
version control so it's the perfect place to put configuration files
- Added the ``APPLICATION_ROOT`` configuration variable.
- Implemented :meth:`~flask.testing.TestClient.session_transaction` to
easily modify sessions from the test environment.
- Refactored test client internally. The ``APPLICATION_ROOT``
configuration variable as well as ``SERVER_NAME`` are now properly
used by the test client as defaults.
- Added :attr:`flask.views.View.decorators` to support simpler
decorating of pluggable (class based) views.
- Fixed an issue where the test client if used with the with statement
did not trigger the execution of the teardown handlers.
- Added finer control over the session cookie parameters.
- HEAD requests to a method view now automatically dispatch to the `get`
method if no handler was implemented.
- Implemented the virtual :mod:`flask.ext` package to import extensions
- The context preservation on exceptions is now an integral component of
Flask itself and no longer of the test client. This cleaned up some
internal logic and lowers the odds of runaway request contexts in
New in Werkzeug:
- Removed data structure specific KeyErrors for a general
- Documented :meth:`werkzeug.wrappers.BaseRequest._load_form_data`.
- The routing system now also accepts strings instead of
dictionaries for the `query_args` parameter since we're only
passing them through for redirects.
- Werkzeug now automatically sets the content length immediately when
the :attr:`~werkzeug.wrappers.BaseResponse.data` attribute is set
for efficiency and simplicity reasons.
- The routing system will now normalize server names to lowercase.
- The routing system will no longer raise ValueErrors in case the
configuration for the server name was incorrect. This should make
deployment much easier because you can ignore that factor now.
- Fixed a bug with parsing HTTP digest headers. It rejected headers
with missing nc and nonce params.
- Proxy fix now also updates wsgi.url_scheme based on X-Forwarded-Proto.
- Added support for key prefixes to the redis cache.
- Added the ability to supress some auto corrections in the wrappers
that are now controlled via `autocorrect_location_header` and
`automatically_set_content_length` on the response objects.
- Werkzeug now uses a new method to check that the length of incoming
data is complete and will raise IO errors by itself if the server
fails to do so.
- :func:`~werkzeug.wsgi.make_line_iter` now requires a limit that is
not higher than the length the stream can provide.
- Refactored form parsing into a form parser class that makes it
possible to hook into individual parts of the parsing process for
debugging and extending.
- For conditional responses the content length is no longer set when it
is already there and added if missing.
- Immutable datastructures are hashable now.
- Headers datastructure no longer allows newlines in values to avoid
header injection attacks.
- Made it possible through subclassing to select a different remote
addr in the proxy fix.
- Added stream based URL decoding. This reduces memory usage on large
transmitted form data that is URL decoded since Werkzeug will no
longer load all the unparsed data into memory.
- Memcache client now no longer uses the buggy cmemcache module and
supports pylibmc. GAE is not tried automatically and the dedicated
class is no longer necessary.
- Redis cache now properly serializes data.
- Removed support for Python 2.4