File: template.py

package info (click to toggle)
python-django-compressor 4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,036 kB
  • sloc: python: 4,347; makefile: 140; javascript: 5
file content (12 lines) | stat: -rw-r--r-- 371 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
from django.template import Template, Context
from django.conf import settings

from compressor.filters import FilterBase


class TemplateFilter(FilterBase):

    def input(self, filename=None, basename=None, **kwargs):
        template = Template(self.content)
        context = Context(settings.COMPRESS_TEMPLATE_FILTER_CONTEXT)
        return template.render(context)