File: jinja2ext.py

package info (click to toggle)
django-webpack-loader 0.6.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 196 kB
  • sloc: python: 256; makefile: 3
file content (9 lines) | stat: -rw-r--r-- 321 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
import jinja2.ext

from ..templatetags.webpack_loader import render_bundle


class WebpackExtension(jinja2.ext.Extension):
    def __init__(self, environment):
        super(WebpackExtension, self).__init__(environment)
        environment.globals["render_bundle"] = lambda *a, **k: jinja2.Markup(render_bundle(*a, **k))