Add an additionnal panel to the admin status displaying if DEBUG is turned on

This commit is contained in:
T'rahk Rokym 2025-07-09 21:36:45 +02:00
parent 34b94ae685
commit 0d9fd0049b
4 changed files with 17 additions and 0 deletions

View File

@ -245,6 +245,7 @@ CACHES = {
SESSION_ENGINE = "django.contrib.sessions.backends.cached_db"
DEBUG = True
DISPLAY_DEBUG = True
ALLOWED_HOSTS = ["*"]
DATABASES = {
"default": {

View File

@ -118,6 +118,20 @@
</div>
</div>
{% if debug %}
<div id="aa-dashboard-panel-debug" class="col-12 mb-3">
<div class="card text-bg-warning">
<div class="card-body">
<h5 class="card-title">{% translate "Debug mode" %}</h5>
<p class="card-text">
{% translate "Debug mode is currently turned on. Make sure to turn it off as soon as you are finished testing" %}
</p>
</div>
</div>
</div>
{% endif %}
<script>
const elemRunning = document.getElementById("task-counts");
const elemQueued = document.getElementById("queued-tasks-count");

View File

@ -52,6 +52,7 @@ def status_overview() -> dict:
"tasks_total": 0,
"tasks_hours": 0,
"earliest_task": None,
"debug": settings.DEBUG if settings.DISPLAY_DEBUG else False,
}
response.update(_current_notifications())
response.update(_current_version_summary())

View File

@ -237,6 +237,7 @@ There are two Django settings files: ``base.py`` and ``local.py``. The base sett
```python
DEBUG = True
DISPLAY_DEBUG = False
```
Define URL and name of your site: