# Kick off django config machinery first from django.conf import settings settings.configure(TEMPLATE_DIRS=("/whatever/templates",)) import django.template import django.template.loader def render(name, *values): ctx = django.template.Context() for d in values: ctx.push() ctx.update(d) t = django.template.loader.get_template(name) return t.render(ctx) print render('layout.tmpl', dict(title='User'), dict(name='Bob', gender='M'))
You need to create an account or log in to post comments to this site.