Browse Source

Arreglo para que se vean las imágenes en producción con debug = true

politica
Celestino Rey 1 year ago
parent
commit
2a28e3c908
8 changed files with 11 additions and 9 deletions
  1. +1
    -1
      Libros/K8S/Makefile
  2. +3
    -2
      Libros/biblioteca/biblioteca/settings.py
  3. +1
    -1
      Libros/biblioteca/biblioteca/urls.py
  4. +1
    -1
      Libros/biblioteca/gestion/templates/_cabecera.html
  5. +1
    -1
      RepostajesDj/K8S/Makefile
  6. +1
    -1
      RepostajesDj/vehiculos/repostajes/templates/_cabecera.html
  7. +2
    -1
      RepostajesDj/vehiculos/vehiculos/settings.py
  8. +1
    -1
      RepostajesDj/vehiculos/vehiculos/urls.py

+ 1
- 1
Libros/K8S/Makefile View File

@ -1,5 +1,5 @@
export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':') export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':')
export IMG_VERSION = 1.43
export IMG_VERSION = 1.46
export IMG_NGINX_VERSION = 1.17 export IMG_NGINX_VERSION = 1.17
# limpia todo # limpia todo


+ 3
- 2
Libros/biblioteca/biblioteca/settings.py View File

@ -27,7 +27,7 @@ SECRET_KEY = os.environ.get("SECRET_KEY")
# SECURITY WARNING: don't run with debug turned on in production! # SECURITY WARNING: don't run with debug turned on in production!
# DEBUG = True # DEBUG = True
DEBUG = bool(os.environ.get("DEBUG", default=0))
DEBUG = os.environ["DEBUG"] == 'True'
ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS").split(" ") ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS").split(" ")
@ -141,7 +141,8 @@ LOGOUT_REDIRECT_URL = 'principal'
AUTH_USER_MODEL = "gestion.ReyMotaUser" AUTH_USER_MODEL = "gestion.ReyMotaUser"
MEDIA_ROOT = os.path.join(BASE_DIR, 'mediafiles/')
MEDIA_ROOT = BASE_DIR / "mediafiles"
MEDIA_URL = '/media/'
LOGGING = { LOGGING = {


+ 1
- 1
Libros/biblioteca/biblioteca/urls.py View File

@ -35,6 +35,6 @@ urlpatterns = [
] ]
if settings.DEBUG:
if not settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, urlpatterns += static(settings.MEDIA_URL,
document_root=settings.MEDIA_ROOT) document_root=settings.MEDIA_ROOT)

+ 1
- 1
Libros/biblioteca/gestion/templates/_cabecera.html View File

@ -15,7 +15,7 @@
<div class="app-utilities col-auto"> <div class="app-utilities col-auto">
<div class="app-utility-item app-user-dropdown dropdown"> <div class="app-utility-item app-user-dropdown dropdown">
{% if user.is_authenticated %} {% if user.is_authenticated %}
<a class="dropdown-toggle" id="user-dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false"><img src="{{ BASE_DIR }}/{{user.foto }}"></a>
<a class="dropdown-toggle" id="user-dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false"><img src=" {{user.foto.url }}"></a>
{% else %} {% else %}
<a class="dropdown-toggle" id="user-dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">Sin usuario</a> <a class="dropdown-toggle" id="user-dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">Sin usuario</a>
{% endif %} {% endif %}


+ 1
- 1
RepostajesDj/K8S/Makefile View File

@ -1,7 +1,7 @@
export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':') export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':')
#export REGISTRY=registry.cube.local #export REGISTRY=registry.cube.local
export REGISTRY=registry.reymota.es export REGISTRY=registry.reymota.es
export IMG_VERSION = 1.7
export IMG_VERSION = 1.12
export IMG_NGINX_VERSION = 1.0 export IMG_NGINX_VERSION = 1.0
# limpia todo # limpia todo


+ 1
- 1
RepostajesDj/vehiculos/repostajes/templates/_cabecera.html View File

@ -15,7 +15,7 @@
<div class="app-utilities col-auto"> <div class="app-utilities col-auto">
<div class="app-utility-item app-user-dropdown dropdown"> <div class="app-utility-item app-user-dropdown dropdown">
{% if user.is_authenticated %} {% if user.is_authenticated %}
<a class="dropdown-toggle" id="user-dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false"><img src="{{ BASE_DIR }}/{{user.foto }}"></a>
<a class="dropdown-toggle" id="user-dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false"><img src=" {{user.foto.url }}"></a>
{% else %} {% else %}
<a class="dropdown-toggle" id="user-dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">Sin usuario</a> <a class="dropdown-toggle" id="user-dropdown-toggle" data-bs-toggle="dropdown" href="#" role="button" aria-expanded="false">Sin usuario</a>
{% endif %} {% endif %}


+ 2
- 1
RepostajesDj/vehiculos/vehiculos/settings.py View File

@ -140,7 +140,8 @@ LOGOUT_REDIRECT_URL = 'principal'
AUTH_USER_MODEL = "repostajes.ReyMotaUser" AUTH_USER_MODEL = "repostajes.ReyMotaUser"
MEDIA_ROOT = os.path.join(BASE_DIR, 'mediafiles/')
MEDIA_ROOT = BASE_DIR / "mediafiles"
MEDIA_URL = '/media/'
# if DEBUG is False: # if DEBUG is False:
CSRF_TRUSTED_ORIGINS = os.environ.get("CSRF_TRUSTED_ORIGINS").split(" ") CSRF_TRUSTED_ORIGINS = os.environ.get("CSRF_TRUSTED_ORIGINS").split(" ")

+ 1
- 1
RepostajesDj/vehiculos/vehiculos/urls.py View File

@ -33,6 +33,6 @@ urlpatterns = [
name="principal"), # new name="principal"), # new
] ]
if settings.DEBUG:
if not settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, urlpatterns += static(settings.MEDIA_URL,
document_root=settings.MEDIA_ROOT) document_root=settings.MEDIA_ROOT)

Loading…
Cancel
Save