Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/s-m-i-t-a/jinja2-stl
A Filestorage template loader for Jinja2.
https://github.com/s-m-i-t-a/jinja2-stl
hacktoberfest
Last synced: 5 days ago
JSON representation
A Filestorage template loader for Jinja2.
- Host: GitHub
- URL: https://github.com/s-m-i-t-a/jinja2-stl
- Owner: s-m-i-t-a
- License: mit
- Created: 2014-08-26T07:27:02.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2014-08-27T13:38:47.000Z (about 10 years ago)
- Last Synced: 2023-03-25T22:45:21.545Z (over 1 year ago)
- Topics: hacktoberfest
- Language: Python
- Homepage:
- Size: 324 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
==================================
Jinja2 Filestorage Template Loader
==================================.. image:: https://badge.fury.io/py/jinja2-stl.png
:target: http://badge.fury.io/py/jinja2-stl.. image:: https://travis-ci.org/s-m-i-t-a/jinja2-stl.png?branch=master
:target: https://travis-ci.org/s-m-i-t-a/jinja2-stl.. image:: https://coveralls.io/repos/s-m-i-t-a/jinja2-stl/badge.png
:target: https://coveralls.io/r/s-m-i-t-a/jinja2-stlA Filestorage template loader for Jinja2.
Features
--------* Load templates from *Django like* storage
* Free software: MIT licenseQuickstart
----------
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.