Configure and show messages (required for login)

This commit is contained in:
Tobias Kunze 2025-03-16 18:52:04 +01:00
parent ccbb288f68
commit f0ad232ff4
3 changed files with 16 additions and 0 deletions

View file

@ -28,6 +28,9 @@
</h3>
</div>
<div class="page-content">
{% for message in messages %}
{% include "includes/message.html" %}
{% endfor %}
{% block content %}
{% endblock content %}
</div>

View file

@ -0,0 +1,7 @@
<div class="alert alert-{{ message.tags }} alert-dismissible">
{{ message }}
<button type="button"
class="btn-close"
data-bs-dismiss="alert"
aria-label="Close"></button>
</div>

View file

@ -12,6 +12,8 @@ Servala is run using environment variables. Documentation:
import os
from pathlib import Path
from django.contrib import messages
SERVALA_ENVIRONMENT = os.environ.get("SERVALA_ENVIRONMENT", "development")
DEBUG = SERVALA_ENVIRONMENT == "development"
@ -143,6 +145,10 @@ TEMPLATES = [
},
]
MESSAGE_TAGS = {
messages.ERROR: "danger",
}
AUTH_USER_MODEL = "core.User"
AUTH_PASSWORD_VALIDATORS = [
{