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

Python Requiring Emails and Customization

Chris Komaroff
PLUS
Chris Komaroff
Courses Plus Student 14,198 Points

My source code for 3 templates

These are copied from code in the video, they work for me.

templates/account/email_confirm.html

{% extends "layout.html" %}
{% load account socialaccount %}

{% block body_content %}
<div class="container">
    <h1>Confirm Email</h1>

    {% if confirmation %}
    <p>Please confirm that <strong>{{ confirmation.email_address.email }}</strong>
    is a valid address for <strong>{{ confirmation.email_address.user }}</strong></p>

    <form method="post">
        {% csrf_token %}
        <button class="btn btn-primary" type="submit">Confirm</button>
    </form>
    {% else %}
    <p>This email confirmation link has expired. Please <a href="{% url 'account_email' %}">
    Click here</a> to issue a new confirmation email.</p>
    {% endif %}
</div>
{% endblock %}

templates/account/verification_sent.html

{% extends "layout.html" %}
{% load account socialaccount %}

{% block body_content %}
<div class="container">
    <h1>Verify your email</h1>
    <p>A link has been sent to you via email. You'll need to click that
    link to verify your email and log into your MSF account.</p>
    <p>Please contact us if you don't receive the email in the next few
    minutes. Be sure to check your spam folders.</p>
</div>
{% endblock %}

templates/account/logout.html

{% extends "layout.html" %}

{% block body_content %}
<div class="container">
    <h1>Log out</h1>

    <p>Are you sure you want to log out?</p>

    <form method="post">
        {% csrf_token %}
        <button class="btn btn-primary" type="submit">Log out</button>
    </form>
</div>
{% endblock %}