Webapp2

Latest version: v2.5.2

Safety actively analyzes 629678 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 5 of 7

1.6

==========================
- Handlers registered in WSGIApplication.error_handlers can now also be a
string to be lazily imported.

- The request object now has the active response available as an attribute:
request.response.

- Added a factory method to RequestHandler, to better deal with libraries that
use a custom webapp.RequestHandler constructors (like ProtoRPC).

- Added set_dispatcher() to Router, to set extended dispatching.

- Handlers and error handlers can now return a response object, which will be
used instead of the default response created by the WSGI app. This allows
webapp2 to be used following the common pattern of handlers that return a
response, instead of the webapp way of a handler that writes to an existing
response.

- Request.Handler.redirect() now can receive a `code` parameter, to set the
status code. This is preferable than the `permanent` parameter, kept for
compatibility with webapp.

- webapp2 is now a file webapp2.py, instead of a package with a __init__.py
file.

- API cleanup:
- Removed WSGIApplication.url_for(), to_unicode(), to_utf8().
- RequestHandler.url_for was renamed to uri_for, with url_for kept
as an alias.
- Renamed webapp2_extras.routes.ImprovedRoute to RedirectRoute, as it
basically adds redirect conveniences.
- For consistency with uri building parameters, RedirectHandler parameters
are now prefixed with a underscore: `url` becomes `_uri` and `permanent`
becomes `_permanent`. A parameter `_code` was added to set status code.
- Router.do_match and do_build renamed to default_matcher and
default_dispatcher.
- URI building accepts a _fragment argument, with _anchor as fallback.

1.5

==========================
- Added webapp2_extras.local, with an extended WSGIApplication that uses
thread-local for globals and so can be used outside of App Engine.

- Added webapp2_extras.protorpc, with support for Google ProtoRPC.

- Added set_matcher() and set_builder() to Router, to set extended matcher and
builder.

- Routes now return the route on match() or routes with nested routes cannot
work. So instead of returning (args, kwargs) they return
(route, args, kwargs).

- Now handlers only receive **args if no named variables are set. Otherwise,
they only receive **kwargs. This allows users to use regexes that are not
intended to be captured, mixing named and unnamed variables.

- DomainRoute now uses the same syntax used by webapp2.Route, instead of a
regex. The resulting keywords are added to the mathed route **kwargs.
This gives control of what is passed to the handler if a domain/subdomain
matches, and allows to not pass anything if no regex groups are defined.

- Several small bugs fixed and increased test coverage in webapp2_extras.

1.3

=========================
- Added webapp2_extras modules:
- webapp2_extras.i18n: internationalization support.
- webapp2_extras.sessions_memcache: memcache based sessions.
- webapp2_extras.sessions_ndb: datastore based sessions.
- Several api improvements in webapp2_extras.

1.2

=========================
- Removed Config from webapp2 core. It is now part of the new "webapp2_extras"
package.
- Added the package webapp2_extras. These are all optional modules that
complement webapp2 with common functionalities. Currently they include:
- webapp2_extras.config: Configuration object.
- webapp2_extras.jinja2: Support for Jinja2 templating.
- webapp2_extras.json: JSON utilities.
- webapp2_extras.routes: Extended route classes.
- webapp2_extras.securecookie: Signed cookie serializer.
- webapp2_extras.sessions: Sessions support.

1.1

=========================
- Simplified routing with an unified dispatch method for classes and functions.

1.0

===========================
This is a major refactoring with some incompatible changes, mostly internal
stuff that won't be noticed in common usage.

- Changed signature of RequestHandler's constructor: it now receives only
(request, response) instead of (app, request, response).

- Added RequestContext class, which should help testing.

- Added .app attribute to Request, a reference to the active app.

- Refactored routing scheme:
- Now also supports function views besides classes.
- Now also supports normal functions as exception handlers, and exception
handlers don't need to be a subclass RequestHandler (but still can).
- Now also supports custom handler methods besides using the request method.

- Removed Request.context: was redundant with Request.registry.

- Renamed WSGIApplication.wsgi_app to WSGIApplication.dispatch.

- Moved ALLOWED_METHODS to WSGIApplication.allowed_methods.

- Moved get_valid_methods() to RequestHandler.get_valid_methods().

Page 5 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.