Browse Source

Nueva versión y quito la condición de debug en csrf

politica
Celestino Rey 1 year ago
parent
commit
202d13758d
4 changed files with 16 additions and 16 deletions
  1. +2
    -2
      RepostajesDj/K8S/Makefile
  2. +3
    -3
      RepostajesDj/K8S/env-prod-configmap.yaml
  3. +8
    -8
      RepostajesDj/K8S/vehiculos.sql
  4. +3
    -3
      RepostajesDj/vehiculos/vehiculos/settings.py

+ 2
- 2
RepostajesDj/K8S/Makefile View File

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


+ 3
- 3
RepostajesDj/K8S/env-prod-configmap.yaml View File

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


+ 8
- 8
RepostajesDj/K8S/vehiculos.sql View File

@ -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
\.

+ 3
- 3
RepostajesDj/vehiculos/vehiculos/settings.py View File

@ -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(" ")

Loading…
Cancel
Save