Browse Source

Merge branch 'main' of https://gogs.reymota.es/creylopez/AppsPy into main

politica
Celestino Rey 1 year ago
parent
commit
45004f7d6a
10 changed files with 174 additions and 8 deletions
  1. +1
    -1
      JugarAlPadel/K8S/Makefile
  2. +51
    -0
      JugarAlPadel/K8S/Makefile.local
  3. +5
    -0
      JugarAlPadel/K8S/creaDirs.sh
  4. +2
    -2
      JugarAlPadel/K8S/env-prod-configmap.yaml
  5. +2
    -3
      JugarAlPadel/README.md
  6. +17
    -0
      JugarAlPadel/gestion_reservas/templates/base.html
  7. +1
    -1
      JugarAlPadel/gestion_reservas/templates/eventos/lista_eventos.html
  8. +0
    -1
      JugarAlPadel/gestion_reservas/templates/registration/login.html
  9. +20
    -0
      JugarAlPadel/gestion_reservas/templates/registration/password_change_done.html
  10. +75
    -0
      JugarAlPadel/gestion_reservas/templates/registration/password_change_form.html

+ 1
- 1
JugarAlPadel/K8S/Makefile View File

@ -2,7 +2,7 @@ export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':')
#export REGISTRY=localhost:5000 #export REGISTRY=localhost:5000
export REGISTRY=registry.reymota.es export REGISTRY=registry.reymota.es
export IMG_VERSION = 0.17
export IMG_VERSION = 0.19
export IMG_NGINX_VERSION = 2.3 export IMG_NGINX_VERSION = 2.3
# limpia todo # limpia todo


+ 51
- 0
JugarAlPadel/K8S/Makefile.local View File

@ -0,0 +1,51 @@
export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':')
export REGISTRY=localhost:5000
#export REGISTRY=registry.reymota.es
export IMG_VERSION = 0.21
export IMG_NGINX_VERSION = 2.4
# limpia todo
all: imagen clean install
imagen:
cd ../; make
install:
-kubectl create -f namespace.yaml
-kubectl create -f reg-secret.yaml
-kubectl create -f env-prod-configmap.yaml
-kubectl create -f env-prod-db-configmap.yaml
-kubectl create -f pv-local-jugaralpadel.yaml
-kubectl create -f jugaralpadel-prod-persistentvolumeclaim.yaml
-kubectl create -f static-volume-persistentvolumeclaim.yaml
-kubectl create -f postgres-data-persistentvolumeclaim.yaml
-kubectl create -f db-deployment.yaml
-kubectl create -f db-service.yaml
-envsubst < jugaralpadel-deployment.yaml |kubectl create -f -
-envsubst < nginx-deployment.yaml |kubectl create -f -
-kubectl create -f nginx-service.yaml
clean:
-envsubst < nginx-deployment.yaml |kubectl delete -f -
-kubectl delete -f nginx-service.yaml
-envsubst < jugaralpadel-deployment.yaml |kubectl delete -f -
-kubectl delete -f db-deployment.yaml
-kubectl delete -f db-service.yaml
-kubectl delete -f env-prod-configmap.yaml
-kubectl delete -f env-prod-db-configmap.yaml
-kubectl delete -f postgres-data-persistentvolumeclaim.yaml
-kubectl delete -f static-volume-persistentvolumeclaim.yaml
-kubectl delete -f jugaralpadel-prod-persistentvolumeclaim.yaml
-kubectl delete -f pv-local-jugaralpadel.yaml
-kubectl delete -f reg-secret.yaml
-kubectl delete -f namespace.yaml
nginx:
cd ../nginx; make

+ 5
- 0
JugarAlPadel/K8S/creaDirs.sh View File

@ -0,0 +1,5 @@
sudo mkdir -p /mnt/Externo/jugaralpadel/media
sudo mkdir -p /mnt/Externo/jugaralpadel/migrations/eventos
sudo mkdir -p /mnt/Externo/jugaralpadel/migrations/reymotausers
sudo mkdir -p /mnt/Externo/jugaralpadel/static
sudo mkdir -p /mnt/Externo/jugaralpadel/pg

+ 2
- 2
JugarAlPadel/K8S/env-prod-configmap.yaml View File

@ -1,8 +1,8 @@
apiVersion: v1 apiVersion: v1
data: data:
DEBUG: "False" DEBUG: "False"
DJANGO_ALLOWED_HOSTS: "jugaralpadel.ddns.net reymota.es k8s-server localhost 127.0.0.1 [::1]"
CSRF_TRUSTED_ORIGINS: "https://jugaralpadel.ddns.net"
DJANGO_ALLOWED_HOSTS: "jugaralpadel.ddns.net vmcluster reymota.es k8s-server localhost 127.0.0.1 [::1]"
CSRF_TRUSTED_ORIGINS: "https://jugaralpadel.ddns.net http://vmcluster"
SECRET_KEY: change_me SECRET_KEY: change_me
SQL_DATABASE: jugaralpadel SQL_DATABASE: jugaralpadel
SQL_ENGINE: django.db.backends.postgresql SQL_ENGINE: django.db.backends.postgresql


+ 2
- 3
JugarAlPadel/README.md View File

@ -2,7 +2,7 @@
Desde el directorio K8S ejecutar make (esto hace todo: la imagen, para los pods y los lanza otra vez) Desde el directorio K8S ejecutar make (esto hace todo: la imagen, para los pods y los lanza otra vez)
La primera vez, hay que entrar en el pod de vehículos con 'entra.sh' y
La primera vez, hay que entrar en el pod con 'entra.sh' y
python manage.py createsuperuser python manage.py createsuperuser
@ -41,9 +41,8 @@ https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/
## Cambiar la secuencia de lo sid
## Cambiar la secuencia de los id
ALTER SEQUENCE tablename_id_seq RESTART WITH nn; ALTER SEQUENCE tablename_id_seq RESTART WITH nn;
esto se hace cuando restauro un volcado de la bd sobre una instalación nueva. Si hay índices ya creados, hay que reinciar a partir del último. esto se hace cuando restauro un volcado de la bd sobre una instalación nueva. Si hay índices ya creados, hay que reinciar a partir del último.

+ 17
- 0
JugarAlPadel/gestion_reservas/templates/base.html View File

@ -34,6 +34,23 @@
<li> <li>
<a class="dropdown-item">{{ user.nombre }}</a> <a class="dropdown-item">{{ user.nombre }}</a>
</li> </li>
<li><a class="dropdown-item">
<form method="post" action="{% url 'password_change' %}" >
{% csrf_token %}
<button
style="background: none!important;
border: none;
padding: 0!important;
/*optional*/
font-family: arial, sans-serif;
/*input has OS specific font-family*/
/*color: #069;
text-decoration: underline;*/
cursor: pointer;"
type="submit">Cambiar contraseña</button>
</form></a>
</li>
<li><a class="dropdown-item"> <li><a class="dropdown-item">
<form method="post" action="{% url 'logout' %}" > <form method="post" action="{% url 'logout' %}" >
{% csrf_token %} {% csrf_token %}


+ 1
- 1
JugarAlPadel/gestion_reservas/templates/eventos/lista_eventos.html View File

@ -67,7 +67,7 @@
</tbody> </tbody>
</table> </table>
{% else %} {% else %}
<p>No se han encontrado eventos para este autor</p>
<p>No se han encontrado eventos.</p>
{% endif %} {% endif %}
</div> </div>


+ 0
- 1
JugarAlPadel/gestion_reservas/templates/registration/login.html View File

@ -84,6 +84,5 @@
</div><!--//auth-background-col--> </div><!--//auth-background-col-->
</div><!--//row--> </div><!--//row-->
</body> </body>
</html> </html>

+ 20
- 0
JugarAlPadel/gestion_reservas/templates/registration/password_change_done.html View File

@ -0,0 +1,20 @@
{% extends "admin/base_site.html" %}
{% load i18n %}
{% block userlinks %}
{% url 'django-admindocs-docroot' as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% translate 'Documentation' %}</a> / {% endif %}{% translate 'Change password' %} /
<form id="logout-form" method="post" action="{% url 'admin:logout' %}">
{% csrf_token %}
<button type="submit">{% translate 'Log out' %}</button>
</form>
{% include "admin/color_theme_toggle.html" %}
{% endblock %}
{% block breadcrumbs %}
<div class="breadcrumbs">
<a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
&rsaquo; {% translate 'Password change' %}
</div>
{% endblock %}
{% block content %}
<p>{% translate 'Your password was changed.' %}</p>
{% endblock %}

+ 75
- 0
JugarAlPadel/gestion_reservas/templates/registration/password_change_form.html View File

@ -0,0 +1,75 @@
{% load i18n static %}
{% include "_head.html" %}
<body class="app app-login p-0">
<div class="row g-0 app-auth-wrapper">
<div class="col-12 col-md-7 col-lg-6 auth-main-col text-center p-5">
<div class="d-flex flex-column align-content-end">
<div class="app-auth-body mx-auto">
{% include "_branding.html" %}
<h2 class="auth-heading text-center mb-5">Cambio de contraseña</h2>
{% if form.errors and not form.non_field_errors %}
<p class="errornote">
{% blocktranslate count counter=form.errors.items|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktranslate %}
</p>
{% endif %}
<form class="auth-form login-form" action="{{ app_path }}" method="post" id="change-form">{% csrf_token %}
<p>{% translate 'Please enter your old password, for security’s sake, and then enter your new password twice so we can verify you typed it in correctly.' %}</p>
<div class="password mb-3">
{{ form.old_password.errors }}
{{ form.old_password.label_tag }}
</div>
<div class="password mb-3">
{{ form.old_password }}
</div>
<div class="password mb-3">
{{ form.new_password.errors }}
{{ form.new_password.label_tag }}
</div>
<div class="password mb-3">
{{ form.new_password }}
</div>
<div class="password mb-3">
{{ form.new_password1.errors }}
{{ form.new_password1.label_tag }}
</div>
<div class="password mb-3">
{{ form.new_password1 }}
{% if form.new_password1.help_text %}
<div class="text mb-e"{% if form.new_password1.id_for_label %} id="{{ form.new_password1.id_for_label }}_helptext"{% endif %}>{{ form.new_password1.help_text|safe }}</div>
{% endif %}
</div>
<div class="password mb-3">
{{ form.new_password2.errors }}
{{ form.new_password2.label_tag }}
{{ form.new_password2 }}</div>
</div>
<div class="password mb-3">
{% if form.new_password2.help_text %}
<div class="help"{% if form.new_password2.id_for_label %} id="{{ form.new_password2.id_for_label }}_helptext"{% endif %}>{{ form.new_password2.help_text|safe }}</div>
{% endif %}
</div>
<div class="text-center">
<input type="submit" value="{% translate 'Change my password' %}" class="btn app-btn-primary w-100 theme-btn mx-auto">
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</body>

Loading…
Cancel
Save