Q:

If statement template in Django

I'm trying to create an if-statement to display if event type is online or in person.
if its online then automatically display online, if not its gonna display location
<div class='upcoming_events'>
    {% for event in page.get_upcoming_events %}
        <div>
        {{ event.title }}
            <p>
                {{ event.start}} | 
                {% if event_type == Online}
                    Online
                {% elif event_type == "In Person" %}
                    {{ event.location }}
                {% endif %}
            </p>    
                <p><a href="http://www.google.com">Read more</a></p>
        </div>
    {% endfor %}
    </div>

im getting error saying " Invalid block tag on line 54: 'elif', expected 'empty' or 'endfor'. "
how can i resolve issue?

A:

You need to change your first if. 
Try: {% if event_type == "Online" %}
(adding " and a missing %)
Edit 1
If nothing is showing up after this I suggest putting in an {% else %} statement to prove that this is falling through the if statement. 
I don't know your code but from what I can gather you probably also need to change the way you are accessing the event_type. If I've read it correctly it should be event.type instead.

