diff --git a/src/reymota/context_processors.py b/src/reymota/context_processors.py new file mode 100644 index 0000000..f5998a5 --- /dev/null +++ b/src/reymota/context_processors.py @@ -0,0 +1,6 @@ +from django.conf import settings + +def app_version(request): + return { + 'APP_VERSION': settings.APP_VERSION + } diff --git a/src/reymota/settings.py b/src/reymota/settings.py index 053346d..39d2a66 100644 --- a/src/reymota/settings.py +++ b/src/reymota/settings.py @@ -12,6 +12,9 @@ https://docs.djangoproject.com/en/5.1/ref/settings/ from pathlib import Path import os +import logging + +APP_VERSION = "11.0.2" # Build paths inside the project like this: BASE_DIR / 'subdir'. BASE_DIR = Path(__file__).resolve().parent.parent @@ -67,6 +70,7 @@ TEMPLATES = [ 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', + 'reymota.context_processors.app_version', ], 'libraries': { 'filtros_de_entorno': 'reymota.templatetags.filtros_de_entorno', @@ -149,3 +153,57 @@ MEDIA_URL = '/media/' CSRF_TRUSTED_ORIGINS = ["https://*.ocp-cluster.reymota.lab"] +LOGGING = { + 'version': 1, + 'disable_existing_loggers': False, + 'formatters': { + 'verbose': { + 'format': '{levelname} {asctime} {module} {message}', + 'style': '{', + }, + 'simple': { + 'format': '{levelname} {message}', + 'style': '{', + }, + }, + 'handlers': { + 'console': { + 'level': 'DEBUG', + 'class': 'logging.StreamHandler', + 'formatter': 'simple', + }, + 'file': { + 'level': 'DEBUG', + 'class': 'logging.FileHandler', + 'filename': '/dev/null', + 'formatter': 'verbose', + }, + 'mail_admins': { + 'level': 'ERROR', + 'class': 'django.utils.log.AdminEmailHandler', + }, + }, + 'loggers': { + 'django': { + 'handlers': ['file'], + 'level': 'DEBUG', + 'propagate': True, + }, + 'repostajes': { + 'handlers': ['console', 'file'], + 'level': 'DEBUG', + 'propagate': False, + }, + 'lyrics': { + 'handlers': ['console', 'file'], + 'level': 'DEBUG', + 'propagate': False, + }, + 'django.request': { + 'handlers': ['mail_admins'], + 'level': 'ERROR', + 'propagate': False, + }, + }, +} + diff --git a/src/templates/_branding.html b/src/templates/_branding.html index 95aaf7d..93dbb30 100644 --- a/src/templates/_branding.html +++ b/src/templates/_branding.html @@ -4,11 +4,5 @@