This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This plugin allows you to specify a renderer for per route. Here is an example

from bottle import Bottle
from bottle_renderer import RendererPlugin

app = Bottle()
renderer = RendererPlugin(template_context = {'FB_APP_ID': 1234}) # This will be available in templates

# You can override the renderers by specifying your own.
# renderer.add_renderer('json', your_json_renderer)

app.install(renderer)
app.uninstall('json') # no autojson

# to use in a route, just specify the "renderer" attribute
@app.get('/main', name='main', renderer='main.jinja2')
def get_main():
    # do something
    return ret_value

In your templates (jinja2, mako, etc.) you can access the following by default:

R:return value of the function
app:The current app
request:The current request
response:The current response

The following renderers are available:

@app.get(renderer='json', ..) # Renders return value as json
@app.get(renderer='string', ..) # Renders return value as text/plain
@app.get(renderer='<template_filename>.stpl', ..) # simple
@app.get(renderer='<template_filename>.mako', ..)
@app.get(renderer='<template_filename>.jinja2', ..)
@app.get(renderer='<template_filename>.cheetah', ..)
@app.get(renderer='<template_filename>.simpletal', ..)
Release History

Release History

0.1.1

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
bottle-renderer-0.1.1.tar.gz (2.3 kB) Copy SHA256 Checksum SHA256 Source Oct 9, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting