![]() | 1 | initial version |
Okay, this isn't an answer, this is a continuation of the above comments, but I need room to post code :)
Here's my code, at the end of loaders.py:
def render_text(text, data, request):
env = SkinEnvironment(extensions=['jinja2.ext.i18n'])
template = env.from_string(text)
context = RequestContext(request, data)
return shortcuts.render_to_string(template, data, context)
It works just like if I was using the django Template
:
def render_text(text, data, request):
context = RequestContext(request, data)
template = Template(text)
return template.render(context)
that is to say, it imports settings fine, but still doesn't allow for {% trans %}
tags.
![]() | 2 | No.2 Revision |
Okay, this isn't an answer, this is a continuation of the above comments, but I need room to post code :)
Here's my code, at the end of loaders.py:
It works just like if I was using the django and it returns an error:Template
:
def render_text(text, data, request):
context = RequestContext(request, data)
template = Template(text)
return template.render(context)
dictionary update sequence element #0 has length 1; 2 is required
that is to say, it imports settings fine, but still doesn't allow for {% trans %}
tags.
![]() | 3 | No.3 Revision |
Okay, this isn't an answer, this is a continuation of the above comments, but I need room to post code :)
Here's my code, at the end of loaders.py:
def render_text(text, data, request):
env = Environment(extensions=['jinja2.ext.i18n'])
template = env.from_string(text)
context = RequestContext(request, data)
return shortcuts.render_to_string(template, and it returns an error:
dictionary update sequence element #0 has length 1; 2 is required