Configure and show messages (required for login)
This commit is contained in:
parent
ccbb288f68
commit
f0ad232ff4
3 changed files with 16 additions and 0 deletions
|
@ -28,6 +28,9 @@
|
|||
</h3>
|
||||
</div>
|
||||
<div class="page-content">
|
||||
{% for message in messages %}
|
||||
{% include "includes/message.html" %}
|
||||
{% endfor %}
|
||||
{% block content %}
|
||||
{% endblock content %}
|
||||
</div>
|
||||
|
|
7
src/servala/frontend/templates/includes/message.html
Normal file
7
src/servala/frontend/templates/includes/message.html
Normal 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>
|
|
@ -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 = [
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue