Skip to content

Instantly share code, notes, and snippets.

@j2labs
Created March 27, 2012 04:02
Show Gist options
  • Save j2labs/2212434 to your computer and use it in GitHub Desktop.
Save j2labs/2212434 to your computer and use it in GitHub Desktop.
attempting to make a poisonous Brubeck handler
#! /usr/bin/env python
from brubeck.request_handling import Brubeck, http_response
from brubeck.templating import load_jinja2_env
from brubeck.templating import Jinja2Rendering
app = Brubeck(mongrel2_pair=('ipc://127.0.0.1:9999',
'ipc://127.0.0.1:9998'),
template_loader=load_jinja2_env('./templates/jinja2'))
@app.add_route('^/', method=['GET', 'POST'])
def index(application, message):
print 'App:', application
name = message.get_argument('name', 'dude')
context = {
'name': name,
}
body = application.render_template('success.html', **context)
application = {}
return http_response(body, 200, 'OK', {})
app.run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment