You can use the {% with %} tag.
https://docs.djangoproject.com/en/1.10/ref/templates/builtins/#with


From: django-users@googlegroups.com [mailto:django-users@googlegroups.com] On 
Behalf Of valerio orfano
Sent: Tuesday, April 4, 2017 9:15 AM
To: Django users
Subject: Setting variable in custom template

Hi there

is there any chance to set the value of variable in django custom template?

I am looking for something like {set variable = "test"}

But i Cannot make it to work!

Any clue?

rgds valerio
--
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 
django-users+unsubscr...@googlegroups.com<mailto:django-users+unsubscr...@googlegroups.com>.
To post to this group, send email to 
django-users@googlegroups.com<mailto:django-users@googlegroups.com>.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c62929e8-f049-43e6-b42a-4217fa9188bb%40googlegroups.com<https://groups.google.com/d/msgid/django-users/c62929e8-f049-43e6-b42a-4217fa9188bb%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 django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/2d34e80b0b2d44b8b351e117e8f7bf17%40ISS1.ISS.LOCAL.
For more options, visit https://groups.google.com/d/optout.

Reply via email to