On 11/22/2015 06:21 PM, Patrick Spencer wrote:
> I see what you mean about not being about to have a global list of
> symbols because everything is subject to change. But it would be nice to
> have a default list of symbols available depending on the default
> initial setup.
Yes, the default addit
I see what you mean about not being about to have a global list of symbols
because everything is subject to change. But it would be nice to have a
default list of symbols available depending on the default initial setup.
I think the csrf_token and request token are available in the
django.templ
This explains where the csrf_token and request symbols were loaded. Thanks
for pointing that out.
On Sunday, November 22, 2015 at 5:27:46 PM UTC-6, knbk wrote:
>
> I don't believe there's a list in the documentation, but you can get them
> from the source code at
> https://github.com/django/dja
>
> I'm using Django 1.8.6 with the built in JInja2 support. I spent a while
> trying to figure out how to pass a csrf token to a JInja2 template. After a
> while I realized one could just write {{ csrf_token }} in the template,
> without passing this value through a view, and it would just print o
I don't believe there's a list in the documentation, but you can get them
from the source code at
https://github.com/django/django/blob/master/django/template/backends/jinja2.py#L66
:
if request is not None:
context['request'] = request
context['csrf_input'] = csrf_input_lazy(request)
After reading a bit, it looks like only the Django Template backend can use
context processors, not the Jinja2 backend. If this is true then Jinja2
isn't using any context processors I'm wondering how the Jinja2 templates
are getting the value for csrf_token and request then. I guess from the
Hi there, I'm not a Jinja2 user, but standard Django templates get these variables via context processors. Check out https://docs.djangoproject.com/en/1.8/topics/templates/#context-processors HTH Jirka
7 matches
Mail list logo