Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8158635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:40:15+00:00 2026-06-06T17:40:15+00:00

{{ is_true }} {% if is_true == True %} <h2>Say True</h2> {% else %}

  • 0
{{ is_true }}

{% if is_true == "True" %}
    <h2>Say True</h2>
{% else %}
    <h2> False </h2>
{% endif %}

But instead it went to else clause even though {{ is_true }} returns True

Any idea?

def some_func():
   if ....:
     return True
   else:
     return False
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T17:40:17+00:00Added an answer on June 6, 2026 at 5:40 pm

    You don’t need to use "True" in your template:

    {% if is_true == True %}
    

    Or just:

    {% if is_true %}
    

    If you use "True" in your template then you are comparing the boolean True with the string "True" (which are not the same) and end up in the else clause of your template.
    In other words you would be doing:

    {% if True == "True" %}
        <h2>Say True</h2>
    {% else %}                     # You will end up here
        <h2> False </h2>
    {% endif %}
    

    You can find more info about Django’s Template Language in the documentation

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

with agile estimating, is it true some say to choose intervals like 1/2 to
Why is () is () true, yet (0,) is (0,) is false? I thought
So technically a boolean is True (1) or False(0)...how can I use a boolean
Is there any body can confirm the description here is true? My experience is
Got an issue where MyObj.classnameis(TMyClass.classname) is true and TMyClass(MyObj) works but (MyObj as TMyclass).doSomething
Probably I missed something, but lets say I have this: $('a.delete').click(function(){ resp=window.confirm(Are you sure
I'm having a lot of trouble getting a simple true/false to evaluate properly in
Is there any way in c# .NET 2.0! to combine multiple Predicates? Let's say
There are two weird operators in C#: the true operator the false operator If
When AllowSorting is true on an asp.net GridView, it just makes the headers with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.