skip to navigation
skip to content

bottle-werkzeug 0.1

Werkzeug integration for Bottle.

This plugin adds support for :class:`werkzeug.Response`, all kinds of
:exc:`werkzeug.exceptions` and provides a thread-local instance of
:class:`werkzeug.Request`. It basically turns Bottle into Flask.

The plugin instance doubles as a werkzeug module object, so you don't need to
import werkzeug in your application.

For werkzeug library documentation, see:


import bottle

app = bottle.Bottle()
werkzeug = bottle.ext.werkzeug.Plugin()

req = werkzueg.request # For the lazy.

def say_hello(name):
greet = {'en':'Hello', 'de':'Hallo', 'fr':'Bonjour'}
language = req.accept_languages.best_match(greet.keys())
if language:
return werkzeug.Response('%s %s!' % (greet[language], name))
raise werkzeug.exceptions.NotAcceptable()  
File Type Py Version Uploaded on Size
bottle-werkzeug-0.1.tar.gz (md5) Source 2011-05-12 2KB