Re: List of available Jinja2 global symbols

2015-11-23 Thread Carl Meyer
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

Re: List of available Jinja2 global symbols

2015-11-22 Thread Patrick Spencer
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

Re: List of available Jinja2 global symbols

2015-11-22 Thread Patrick Spencer
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

Re: List of available Jinja2 global symbols

2015-11-22 Thread James Schneider
> > 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

Re: List of available Jinja2 global symbols

2015-11-22 Thread knbk
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)

Re: List of available Jinja2 global symbols

2015-11-22 Thread Patrick Spencer
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

Re: List of available Jinja2 global symbols

2015-11-22 Thread Jirka Vejrazka
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