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/django/blob/master/django/template/backends/jinja2.py#L66
> :
>
> if request is not None:
>     context['request'] = request
>     context['csrf_input'] = csrf_input_lazy(request)
>     context['csrf_token'] = csrf_token_lazy(request)
>
> On Sunday, November 22, 2015 at 1:17:59 PM UTC+1, JirkaV wrote:
>>
>> 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
>>
>> *From: *Patrick Spencer
>> *Sent: *neděle, 22. listopadu 2015 5:45
>> *To: *Django users
>> *Reply To: *[email protected]
>> *Subject: *List of available Jinja2 global symbols
>>
>> 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 out the 
>> token. I also realized you could reference a request object without passing 
>> it through the view i.e. {{ request.user }} returns the current user. Is 
>> there a place in the documentation with all the available global symbols 
>> one can use in a Jinja2 template?
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Django users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> To post to this group, send email to [email protected].
>> Visit this group at http://groups.google.com/group/django-users.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/django-users/537bd366-180e-4876-8b91-5791f8e22d44%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/django-users/537bd366-180e-4876-8b91-5791f8e22d44%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/861c4e44-2fe6-4228-9a17-c28528f0fe29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to