core/base.html & settings.py updated for email-based login & logout

This commit is contained in:
Disco DeDisco
2026-02-01 16:19:07 -05:00
parent d236ab9d69
commit 36f4182a4f
2 changed files with 30 additions and 13 deletions

View File

@@ -146,3 +146,10 @@ LOGGING = {
"root": {"handlers": ["console"], "level": "INFO"},
},
}
# Email Settings
EMAIL_HOST = "smtp.mailgun.org"
EMAIL_HOST_USER = os.environ["EMAIL_HOST_USER"]
EMAIL_HOST_PASSWORD = os.environ["EMAIL_HOST_PASSWORD"]
EMAIL_PORT = 587
EMAIL_USER_TLS = True

View File

@@ -17,6 +17,15 @@
<a href="/" class="navbar-brand">
<h1>Welcome, Earthman</h1>
</a>
{% if user.email %}
<span class="navbar-text">Logged in as {{ user.email }}</span>
<form action="TODO" method="POST">
{% csrf_token %}
<button id="id_logout" class="btn btn-outline-secondary" type="submit">
Log Out
</button>
</form>
{% else %}
<form method="POST" action="{% url "send_login_email" %}">
<div class="input-group">
<label for="id_email_input" class="navbar-text me-2">
@@ -24,13 +33,14 @@
</label>
<input
id="id_email_input"
class="form-control"
name="email"
class="form-control"
placeholder="your@email.here"
>
{% csrf_token %}
</div>
</form>
{% endif %}
</div>
</nav>