Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


jingo's direct_to_template should be consistent with Django's version of it #2

fwenzel opened this Issue · 3 comments

3 participants


Django's direct_to_template allows setting the template, mimetype, and extra_context:

Jingo, instead takes the dictionary it is fed as kwargs and drops its content directly into the context. This makes setting the mime type impossible.


Just replacing direct_to_template with jingo.render in is apparently a workaround.


I like that. Does that mean we can get rid of jingo.views?


I think so. The syntax needs to change from url('/foo', direct_to_template, {template: x.html, var1: ...}) to url('/foo', jingo.render, {template: x.html, context: {var1:..., var2: ...}} -- the nested dictionaries are a little less fun than before, but if we do that, jingo.views becomes obsolete.

@jsocol jsocol closed this issue from a commit
James Socol Remove jingo.views and tests. Fix #2.
With the changes since #2 was filed, it's no longer necessary to have
jingo.views.direct_to_template at all. Django's direct_to_template view
works just fine with jingo.Loader.

I cleaned up some tests, but jingo.render_to_string is still a different
function than django.template.loader.render_to_string, so I wasn't able
to drop that.
@jsocol jsocol closed this in 52b1f57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.