Bottle

Latest version: v0.12.25

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

Scan your dependencies

Page 1 of 2

3.6

versions should not update to Bottle 0.13 and stick with 0.12 instead.

.. rubric:: Stabilized APIs
* The documented API of the :class:`ConfigDict` class is now considered stable and ready to use.

.. rubric:: Deprecated APIs
* The old route syntax (``/hello/:name``) is deprecated in favor of the more readable and flexible ``/hello/<name>`` syntax.
* :meth:`Bottle.mount` now recognizes Bottle instance and will warn about parameters that are not compatible with the new mounting behavior. The old behavior (mount applications as WSGI callable) still works and is used as a fallback automatically.
* The undocumented :func:`local_property` helper is now deprecated.
* The server adapter for google app engine is not useful anymore and marked as deprecated.
* Bottle uses pickle to store arbitrary objects into signed cookies. This is safe, as long as the signature key remains a secret. Unfortunately, people tend to push code with signature keys to github all the time, so we decided to remove pickle-support from bottle. Signed cookies will now issue a deprecation warning if the value is not a string, and support for non-string values will be removed in 0.14. The global :func:`cookie_encode`, :func:`cookie_decode` and :func:`is_cookie_encoded` are now also deprecated. If you are using this feature, think about using json to serialize your objects before storing them into cookies, or switch to a session system that stores data server-side instead of client-side.

0.13

==============

.. warning:: Not released yet.

.. rubric:: Dropped support for Python versions that reached their end-of-life.

Keeping up support for ancient Python versions hinders adaptation of new features
and serves no real purpose. If you need support for older Python versions, you can
stay on bottle-0.12. The updated list of tested and supported python releases is
as follows:

* Python 2.7 (>= 2.7.3)
* Python 3.6
* Python 3.7
* Python 3.8
* Python 3.9
* PyPy 2.7
* PyPy 3.6
* PyPy 3.7

Support for Python 2.5 was marked as deprecated since 0.12. We decided to go a step further
and also remove support for 2.6 and 3.1 to 3.5 even if it was never deprecated explicitly
in bottle. This means that this release is *not* backwards compatible in Python <2.7.3 or

0.12

==============

* New SimpleTemplate parser implementation

* Support for multi-line code blocks (`<% ... %>`).
* The keywords `include` and `rebase` are functions now and can accept variable template names.

* The new :attr:`BaseRequest.route` property returns the :class:`Route` that originally matched the request.
* Removed the ``BaseRequest.MAX_PARAMS`` limit. The hash collision bug in CPythons dict() implementation was fixed over a year ago. If you are still using Python 2.5 in production, consider upgrading or at least make sure that you get security fixed from your distributor.
* New :class:`ConfigDict` API (see :doc:`configuration`)

More information can be found in this `development blog post <http://blog.bottlepy.org/2013/07/19/preview-bottle-012.html>`_.

0.11

==============

* Native support for Python 2.x and 3.x syntax. No need to run 2to3 anymore.
* Support for partial downloads (``Range`` header) in :func:`static_file`.
* The new :class:`ResourceManager` interface helps locating files bundled with an application.
* Added a server adapter for `waitress <http://docs.pylonsproject.org/projects/waitress/en/latest/>`_.
* New :meth:`Bottle.merge` method to install all routes from one application into another.
* New :attr:`BaseRequest.app` property to get the application object that handles a request.
* Added :meth:`FormsDict.decode()` to get an all-unicode version (needed by WTForms).
* :class:`MultiDict` and subclasses are now pickle-able.

.. rubric:: API Changes

* :attr:`Response.status` is a read-write property that can be assigned either a numeric status code or a status string with a reason phrase (``200 OK``). The return value is now a string to better match existing APIs (WebOb, werkzeug). To be absolutely clear, you can use the read-only properties :attr:`BaseResponse.status_code` and :attr:`BaseResponse.status_line`.

.. rubric:: API Deprecations

* :class:`SimpleTALTemplate` is now deprecating. There seems to be no demand.

0.10

==============

* Plugin API v2

* To use the new API, set :attr:`Plugin.api` to ``2``.
* :meth:`Plugin.apply` receives a :class:`Route` object instead of a context dictionary as second parameter. The new object offers some additional information and may be extended in the future.
* Plugin names are considered unique now. The topmost plugin with a given name on a given route is installed, all other plugins with the same name are silently ignored.

* The Request/Response Objects

* Added :attr:`BaseRequest.json`, :attr:`BaseRequest.remote_route`, :attr:`BaseRequest.remote_addr`, :attr:`BaseRequest.query` and :attr:`BaseRequest.script_name`.
* Added :attr:`BaseResponse.status_line` and :attr:`BaseResponse.status_code` attributes. In future releases, :attr:`BaseResponse.status` will return a string (e.g. ``200 OK``) instead of an integer to match the API of other common frameworks. To make the transition as smooth as possible, you should use the verbose attributes from now on.
* Replaced :class:`MultiDict` with a specialized :class:`FormsDict` in many places. The new dict implementation allows attribute access and handles unicode form values transparently.

* Templates

* Added three new functions to the SimpleTemplate default namespace that handle undefined variables: :func:`stpl.defined`, :func:`stpl.get` and :func:`stpl.setdefault`.
* The default escape function for SimpleTemplate now additionally escapes single and double quotes.

* Routing

* A new route syntax (e.g. ``/object/<id:int>``) and support for route wildcard filters.
* Four new wildcard filters: `int`, `float`, `path` and `re`.

* Other changes

* Added command line interface to load applications and start servers.
* Introduced a :class:`ConfigDict` that makes accessing configuration a lot easier (attribute access and auto-expanding namespaces).
* Added support for raw WSGI applications to :meth:`Bottle.mount`.
* :meth:`Bottle.mount` parameter order changed.
* :meth:`Bottle.route` now accepts an import string for the ``callback`` parameter.
* Dropped Gunicorn 0.8 support. Current supported version is 0.13.
* Added custom options to Gunicorn server.
* Finally dropped support for type filters. Replace with a custom plugin of needed.

0.9

============

.. rubric:: Whats new?

* A brand new plugin-API. See :ref:`plugins` and :doc:`plugindev` for details.
* The :func:`route` decorator got a lot of new features. See :meth:`Bottle.route` for details.
* New server adapters for `gevent <http://www.gevent.org/>`_, `meinheld <http://meinheld.org/>`_ and `bjoern <https://github.com/jonashaag/bjoern>`_.
* Support for SimpleTAL templates.
* Better runtime exception handling for mako templates in debug mode.
* Lots of documentation, fixes and small improvements.
* A new :data:`Request.urlparts` property.

.. rubric:: Performance improvements

* The :class:`Router` now special-cases ``wsgi.run_once`` environments to speed up CGI.
* Reduced module load time by ~30% and optimized template parser. See `8ccb2d </commit/8ccb2d>`_, `f72a7c </commit/f72a7c>`_ and `b14b9a </commit/b14b9a>`_ for details.
* Support for "App Caching" on Google App Engine. See `af93ec </commit/af93ec>`_.
* Some of the rarely used or deprecated features are now plugins that avoid overhead if the feature is not used.

.. rubric:: API changes

This release is mostly backward compatible, but some APIs are marked deprecated now and will be removed for the next release. Most noteworthy:

* The ``static`` route parameter is deprecated. You can escape wild-cards with a backslash.
* Type-based output filters are deprecated. They can easily be replaced with plugins.

Page 1 of 2

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.