Using Django view variables inside templates
Posted
by William
on Stack Overflow
See other posts from Stack Overflow
or by William
Published on 2010-06-16T18:51:31Z
Indexed on
2010/06/16
19:02 UTC
Read the original article
Hit count: 213
Hi, this is a rather basic question (I'm new to Django) but I'm having trouble using a variable set in my view inside my template. If I initialize a string or list inside my view (i.e. h = "hello") and then attempt to call it inside a template:
{{ h }}
there is neither output nor errors. Similarly, if I try to use a variable inside my template that doesn't exist:
{{ asdfdsadf }}
there is again no error reported. Is this normal? And how can I use my variables within my templates. Thanks!
© Stack Overflow or respective owner