Release Notes and Changelog¶
Release 0.11¶
- Native support for Python 2.x and 3.x syntax. No need to run 2to3 anymore.
- Support for partial downloads (
Rangeheader) instatic_file(). - The new
ResourceManagerinterface helps locating files bundled with an application. - Added a server adapter for waitress.
- New
Bottle.merge()method to install all routes from one application into another. - New
BaseRequest.appproperty to get the application object that handles a request. - Added
FormsDict.decode()to get an all-unicode version (needed by WTForms). MultiDictand subclasses are now pickle-able.
API Changes
Response.statusis 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 propertiesBaseResponse.status_codeandBaseResponse.status_line.
API Deprecations
SimpleTALTemplateis now deprecating. There seems to be no demand.
Release 0.10¶
- Plugin API v2
- To use the new API, set
Plugin.apito2. Plugin.apply()receives aRouteobject 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.
- To use the new API, set
- The Request/Response Objects
- Added
BaseRequest.json,BaseRequest.remote_route,BaseRequest.remote_addr,BaseRequest.queryandBaseRequest.script_name. - Added
BaseResponse.status_lineandBaseResponse.status_codeattributes. In future releases,BaseResponse.statuswill 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
MultiDictwith a specializedFormsDictin many places. The new dict implementation allows attribute access and handles unicode form values transparently.
- Added
- Templates
- Added three new functions to the SimpleTemplate default namespace that handle undefined variables:
stpl.defined(),stpl.get()andstpl.setdefault(). - The default escape function for SimpleTemplate now additionally escapes single and double quotes.
- Added three new functions to the SimpleTemplate default namespace that handle undefined variables:
- 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.
- A new route syntax (e.g.
- Oher changes
- Added command line interface to load applications and start servers.
- Introduced a
ConfigDictthat makes accessing configuration a lot easier (attribute access and auto-expanding namespaces). - Added support for raw WSGI applications to
Bottle.mount(). Bottle.mount()parameter order changed.Bottle.route()now accpets an import string for thecallbackparameter.- 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.
Release 0.9¶
Whats new?
- A brand new plugin-API. See Plugins and Plugin Development Guide for details.
- The
route()decorator got a lot of new features. SeeBottle.route()for details. - New server adapters for gevent, meinheld and bjoern.
- Support for SimpleTAL templates.
- Better runtime exception handling for mako templates in debug mode.
- Lots of documentation, fixes and small improvements.
- A new
Request.urlpartsproperty.
Performance improvements
- The
Routernow special-caseswsgi.run_onceenvironments to speed up CGI. - Reduced module load time by ~30% and optimized template parser. See 8ccb2d, f72a7c and b14b9a for details.
- Support for “App Caching” on Google App Engine. See af93ec.
- Some of the rarely used or deprecated features are now plugins that avoid overhead if the feature is not used.
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
staticroute parameter is deprecated. You can escape wild-cards with a backslash. - Type-based output filters are deprecated. They can easily be replaced with plugins.
Release 0.8¶
API changes
These changes may break compatibility with previous versions.
- The built-in Key/Value database is not available anymore. It is marked deprecated since 0.6.4
- The Route syntax and behaviour changed.
- Regular expressions must be encapsulated with
#. In 0.6 all non-alphanumeric characters not present in the regular expression were allowed. - Regular expressions not part of a route wildcard are escaped automatically. You don’t have to escape dots or other regular control characters anymore. In 0.6 the whole URL was interpreted as a regular expression. You can use anonymous wildcards (
/index:#(\.html)?#) to achieve a similar behaviour.
- Regular expressions must be encapsulated with
- The
BreakTheBottleexception is gone. UseHTTPResponseinstead. - The
SimpleTemplateengine escapes HTML special characters in{{bad_html}}expressions automatically. Use the new{{!good_html}}syntax to get old behaviour (no escaping). - The
SimpleTemplateengine returns unicode strings instead of lists of byte strings. bottle.optimize()and the automatic route optimization is obsolete.- Some functions and attributes were renamed:
Request._environis nowRequest.environResponse.headeris nowResponse.headersdefault_app()is obsolete. Useapp()instead.
- The default
redirect()code changed from 307 to 303. - Removed support for
@default. Use@error(404)instead.
New features
This is an incomplete list of new features and improved functionality.
- The
Requestobject got new properties:Request.body,Request.auth,Request.url,Request.header,Request.forms,Request.files. - The
Response.set_cookie()andRequest.get_cookie()methods are now able to encode and decode python objects. This is called a secure cookie because the encoded values are signed and protected from changes on client side. All pickle-able data structures are allowed. - The new
Routerclass drastically improves performance for setups with lots of dynamic routes and supports named routes (named route + dict = URL string). - It is now possible (and recommended) to return
HTTPErrorandHTTPResponseinstances or other exception objects instead of raising them. - The new function
static_file()equalssend_file()but returns aHTTPResponseorHTTPErrorinstead of raising it.send_file()is deprecated. - New
get(),post(),put()anddelete()decorators. - The
SimpleTemplateengine got full unicode support. - Lots of non-critical bugfixes.
Contributors¶
Bottle is written and maintained by Marcel Hellkamp <marc@bottlepy.org>.
Thanks to all the people who found bugs, sent patches, spread the word, helped each other on the mailing-list and made this project possible. I hope the following (alphabetically sorted) list is complete. If you miss your name on that list (or want your name removed) please tell me or add it yourself.
- acasajus
- Adam R. Smith
- Alexey Borzenkov
- Alexis Daboville
- Anton I. Sipos
- Anton Kolechkin
- apexi200sx
- apheage
- BillMa
- Brad Greenlee
- Brandon Gilmore
- Branko Vukelic
- Brian Sierakowski
- Brian Wickman
- Carl Scharenberg
- Damien Degois
- David Buxton
- Duane Johnson
- fcamel
- Frank Murphy
- Frederic Junod
- goldfaber3012
- Greg Milby
- gstein
- Ian Davis
- Itamar Nabriski
- Iuri de Silvio
- Jaimie Murdock
- Jeff Nichols
- Jeremy Kelley
- joegester
- Johannes Krampf
- Jonas Haag
- Joshua Roesslein
- Karl
- Kraken
- Kyle Fritz
- m35
- Marcos Neves
- masklinn
- Michael Labbe
- Michael Soulier
- Robert Rollins
- rogererens
- rwxrwx
- Santiago Gala
- Sean M. Collins
- Sebastian Wollrath
- Seth
- Sigurd Høgsbro
- Stuart Rackham
- Sun Ning
- Tomás A. Schertel
- Tristan Zajonc
- voltron
- Wieland Hoffmann
- zombat