From 202d13758db6063f964091c3a38dcdac0581462d Mon Sep 17 00:00:00 2001 From: Celestino Rey Date: Fri, 30 Aug 2024 14:04:34 +0200 Subject: [PATCH] =?UTF-8?q?Nueva=20versi=C3=B3n=20y=20quito=20la=20condici?= =?UTF-8?q?=C3=B3n=20de=20debug=20en=20csrf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RepostajesDj/K8S/Makefile | 4 ++-- RepostajesDj/K8S/env-prod-configmap.yaml | 6 +++--- RepostajesDj/K8S/vehiculos.sql | 16 ++++++++-------- RepostajesDj/vehiculos/vehiculos/settings.py | 6 +++--- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/RepostajesDj/K8S/Makefile b/RepostajesDj/K8S/Makefile index 726958b..c2784a6 100644 --- a/RepostajesDj/K8S/Makefile +++ b/RepostajesDj/K8S/Makefile @@ -1,11 +1,11 @@ export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':') #export REGISTRY=registry.cube.local export REGISTRY=registry.reymota.es -export IMG_VERSION = 1.4 +export IMG_VERSION = 1.6 export IMG_NGINX_VERSION = 1.0 # limpia todo -all: imagen nginx clean install +all: imagen clean install imagen: cd ../; make diff --git a/RepostajesDj/K8S/env-prod-configmap.yaml b/RepostajesDj/K8S/env-prod-configmap.yaml index e1456bf..c800983 100644 --- a/RepostajesDj/K8S/env-prod-configmap.yaml +++ b/RepostajesDj/K8S/env-prod-configmap.yaml @@ -1,8 +1,8 @@ apiVersion: v1 data: - DEBUG: "0" - DJANGO_ALLOWED_HOSTS: "vehiculos.reymota.es k8s-server localhost 127.0.0.1 [::1]" - CSRF_TRUSTED_ORIGINS: "https://vehiculos.reymota.es" + DEBUG: "False" + DJANGO_ALLOWED_HOSTS: "repostajes.reymota.es k8s-server localhost 127.0.0.1 [::1]" + CSRF_TRUSTED_ORIGINS: "https://repostajes.reymota.es" SECRET_KEY: change_me SQL_DATABASE: vehiculos SQL_ENGINE: django.db.backends.postgresql diff --git a/RepostajesDj/K8S/vehiculos.sql b/RepostajesDj/K8S/vehiculos.sql index 3ba493a..1f84c86 100644 --- a/RepostajesDj/K8S/vehiculos.sql +++ b/RepostajesDj/K8S/vehiculos.sql @@ -1,4 +1,12 @@ -- +-- Data for Name: repostajes_vehiculo; Type: TABLE DATA; Schema: public; Owner: creylopez +-- + +COPY public.repostajes_vehiculo (id, marca, modelo, matricula, foto) FROM stdin; +4 Toyota Corolla 7630LYR vehiculos/corolla-active-rojo-0675lrb-1-_Um20SC3.jpg +5 BMW 318d 1018KPD vehiculos/bmw_Y8htLud.png +\. +-- -- Data for Name: repostajes_repostaje; Type: TABLE DATA; Schema: public; Owner: creylopez -- @@ -103,11 +111,3 @@ COPY public.repostajes_repostaje (id, fecha, kms, litros, descuento, importe, pr \. --- --- Data for Name: repostajes_vehiculo; Type: TABLE DATA; Schema: public; Owner: creylopez --- - -COPY public.repostajes_vehiculo (id, marca, modelo, matricula, foto) FROM stdin; -4 Toyota Corolla 7630LYR vehiculos/corolla-active-rojo-0675lrb-1-_Um20SC3.jpg -5 BMW 318d 1018KPD vehiculos/bmw_Y8htLud.png -\. diff --git a/RepostajesDj/vehiculos/vehiculos/settings.py b/RepostajesDj/vehiculos/vehiculos/settings.py index ae5dcd2..c322dff 100644 --- a/RepostajesDj/vehiculos/vehiculos/settings.py +++ b/RepostajesDj/vehiculos/vehiculos/settings.py @@ -24,7 +24,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = os.environ.get("SECRET_KEY") # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = bool(os.environ.get("DEBUG", default=0)) +DEBUG = bool(os.environ.get("DEBUG", default=False)) ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS").split(" ") @@ -142,5 +142,5 @@ AUTH_USER_MODEL = "repostajes.ReyMotaUser" MEDIA_ROOT = os.path.join(BASE_DIR, 'mediafiles/') -if DEBUG == 0: - CSRF_TRUSTED_ORIGINS = os.environ.get("CSRF_TRUSTED_ORIGINS").split(" ") +# if DEBUG is False: +CSRF_TRUSTED_ORIGINS = os.environ.get("CSRF_TRUSTED_ORIGINS").split(" ")