Setting variable in custom template

13 views
Skip to first unread message

valerio orfano

unread,
Apr 4, 2017, 10:14:37 AM4/4/17
to Django users
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

Matthew Pava

unread,
Apr 4, 2017, 10:25:14 AM4/4/17
to django...@googlegroups.com

--
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...@googlegroups.com.
To post to this group, send email to django...@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.
For more options, visit https://groups.google.com/d/optout.

Mahendra Gaur

unread,
Apr 4, 2017, 10:40:04 AM4/4/17
to django...@googlegroups.com
Why do you want to set it in custom template. It would be better if you put this variable in context dictionary while rendering and then use it in the template on the basis of condition.


Thanks and regards,
Mahendra

--
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+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages