Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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

fwenzel opened this Issue May 4, 2010 · 3 comments


None yet
3 participants

fwenzel commented May 4, 2010

Django's direct_to_template allows setting the template, mimetype, and extra_context: http://docs.djangoproject.com/en/dev/ref/generic-views/#django-views-generic-simple-direct-to-template

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.


fwenzel commented May 4, 2010

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


jbalogh commented May 4, 2010

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


fwenzel commented May 4, 2010

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 in 52b1f57 Nov 9, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment