How to render code based on checkbox value in Django?

I want to conditionally render part of form that's responsible for billing address. If user has checkbox checked, don't render it, if unchecked - render.

I tried following:

<div class="big-padding">
    <input type="checkbox" id="billing-same-as-shipping" name="billing-same-as-shipping" checked>
    <label for="billing-same-as-shipping">Billing address same as shipping address</label>
{% if checked in 'billing-same-as-shipping' %}
    <h3>Billing Address</h3>
    <div class="big-padding">
        <div class="row ">
            {% include "views/parts/billing-address.html" %}
{% endif %}

No matter what I try, I can't seem to make conditional rendering work.

Back to Top