跳转到主要内容

未提供项目描述

项目描述

Bottle Jade – 简短描述。

Build Status Coverals http://img.shields.io/pypi/v/bottle-jade.svg?style=flat-square http://img.shields.io/pypi/dm/bottle-jade.svg?style=flat-square Donate

需求

  • python >= 2.6

安装

Bottle Jade 应该使用pip进行安装

pip install bottle-jade

使用

from bottle import Bottle
from bottle_jade import JadePlugin
from os import path as op

app = Bottle()
templates = op.dirname(op.abspath(__file__))
jade = app.install(JadePlugin(template_folder=templates))

@app.route('/')
def index():
    context = {'var': 'value'}
    return jade.render('index.jade', **context)

@app.route('/simple')
@jade.view('simple.jade')
def simple():
    context = {}
    return context

配置

JADE_CACHE_SIZE – 将缓存的模板数量(200) JADE_PRETTY – 启用美观输出(True) JADE_TEMPLATE_FOLDER – 设置模板文件夹路径(templates) JADE_ENCODING – 设置模板的编码(UTF-8)

错误追踪器

如果您有任何建议、错误报告或烦恼,请向https://github.com/klen/bottle-jade/issues 的问题跟踪器报告

贡献

Bottle Jade的开发发生在: https://github.com/klen/bottle-jade

贡献者

  • klen (Kirill Klenov)

许可证

许可协议下: BSD许可证

支持