No project description provided
Project description
Muffin-Jinja2 – Jinja2 template engine for Muffin framework.
Requirements
python >= 3.3
Installation
Muffin-Jinja2 should be installed using pip:
pip install muffin-jinja2
Usage
Add muffin_jinja2 to PLUGINS in your Muffin Application configuration.
Options
JINJA2_AUTO_RELOAD – Auto reload changed templates (False)
JINJA2_CACHE_SIZE – Cache templates (50)
JINJA2_EXTENSIONS – Enable Jinja2 Extensions (None)
JINJA2_LOADER – Template loader (FileSystemLoader)
JINJA2_ENCODING – Default encoding for file loader
JINJA2_TEMPLATE_FOLDERS – List of template folders ([‘templates’])
Views
# Register custom context processor # could be a function/coroutine @app.ps.jinja2.context_processor def custom_context(): return { 'VAR': 'VALUE' } # Register a function into templates @app.ps.jinja2.register def sum(a, b): return a + b @app.register('/') def index(request): """ Check for user is admin. """ local_context = {'key': 'value'} return app.ps.jinja2.render('index.html', **local_context)
Bug tracker
If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/muffin-jinja2/issues
Contributing
Development of Muffin-Jinja2 happens at: https://github.com/klen/muffin-jinja2
Contributors
klen (Kirill Klenov)
License
Licensed under a MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for muffin_jinja2-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3509ae402daae91bacf8b7477ce2bf62da343bb8ea4bb2fe80925d305eeaf2f3 |
|
MD5 | bd4f09c1389286e3b4a1a179cf37ff66 |
|
BLAKE2b-256 | 8dc63a8bcbd06056fb019005d8c6677ea1d52a6f539a43b76dd9b78acb666709 |