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+unsubscribe@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/c62929e8-f049-43e6-b42a-4217fa9188bb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment