Browse Source

Cambio forma demostrar version

main
Celestino Rey 9 months ago
parent
commit
e5a4cbe045
3 changed files with 65 additions and 7 deletions
  1. +6
    -0
      src/reymota/context_processors.py
  2. +58
    -0
      src/reymota/settings.py
  3. +1
    -7
      src/templates/_branding.html

+ 6
- 0
src/reymota/context_processors.py View File

@ -0,0 +1,6 @@
from django.conf import settings
def app_version(request):
return {
'APP_VERSION': settings.APP_VERSION
}

+ 58
- 0
src/reymota/settings.py View File

@ -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,
},
},
}

+ 1
- 7
src/templates/_branding.html View File

@ -4,11 +4,5 @@
<div class="app-branding">
<a class="app-logo" href="{% url 'principal' %}"><img class="logo-icon me-2" src="{% static 'images/reymota-logo.svg' %}" alt="logo"><span class="logo-text">REYMOTA</span>
<span style="color: blue; font-size: 14px;">
{% if 'ENVIRONMENT'|muestra_version == 'Pruebas' %}
p
{% else %}
v
{% endif %}
{{ "VERSION"|muestra_version }}</span></a>
<span style="color: blue; font-size: 14px;">Versión: {{ APP_VERSION }}</span></a>
</div><!--//app-branding-->

Loading…
Cancel
Save