more cleanup, remove supervisr imports

This commit is contained in:
Jens Langhammer
2018-11-16 10:08:15 +01:00
parent fbaab4efaf
commit a2904d3ade
42 changed files with 130 additions and 245 deletions

View File

@ -0,0 +1,14 @@
"""passbook lib template utilities"""
from django.template import Context, Template, loader
def render_from_string(template: str, ctx: Context) -> str:
"""Render template from string to string"""
template = Template(template)
return template.render(ctx)
def render_to_string(template_path: str, ctx: Context) -> str:
"""Render a template to string"""
template = loader.get_template(template_path)
return template.render(ctx)