Skip to main content

A Filestorage template loader for Jinja2.

Project description

https://badge.fury.io/py/jinja2-stl.png https://travis-ci.org/s-m-i-t-a/jinja2-stl.png?branch=master https://coveralls.io/repos/s-m-i-t-a/jinja2-stl/badge.png

A Filestorage template loader for Jinja2.

Features

  • Load templates from Django like storage
  • Free software: MIT license

Quickstart

Install jinja2_stl:

pip install jinja2_stl

Basic usage:

from jinja2 import Environment

from storage import Storage

from jinja2_stl.loader import FilestorageTemplateLoader


loader = FilestorageTemplateLoader(storage=Storage(...))
env = Environment(loader=loader)

template = env.get_template('foo/bar.html')

print(template.render(the='variables', go='here'))

Storage must implements Django Storage API and is used as storage parameter in FilestorageTemplateLoader. The template foo/bar.html is loaded from Storage then is used in convenience way.

History

0.0.1 (2014-08-26)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jinja2_stl-0.0.1.tar.gz (5.3 kB view hashes)

Uploaded source

Built Distribution

jinja2_stl-0.0.1-py2.py3-none-any.whl (4.0 kB view hashes)

Uploaded 3 4

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page