Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Natalie Tan
25,519 PointsLoginView: {% bootstrap_form form %} instead of {{ form }} ?
In this video (https://teamtreehouse.com/library/loginview), the template used to generate the form was
{% bootstrap_form form %}
as opposed to what I'm used to:
{{ form }}
When do you use {% %} as opposed to {{ }} ?
1 Answer
Andreas cormack
Python Web Development Techdegree Graduate 33,011 PointsHi Natalie
# Say i had a class called user with an attribute of isAdmin, and lets say is Admin was True
{% if user.isAdmin %}
<p> do something </p>
{% endif %}
# if i wanted to print out the value of isAdmin
{{ isAdmin}}
long story short, if you want to write python in your templates you use {%%} and if you want to print out a variable you use {{ }}
hope this helps