Brak opisu

Celestino Rey f526fd9a71 Primer commit 1 rok temu
accounts f526fd9a71 Primer commit 1 rok temu
libros f526fd9a71 Primer commit 1 rok temu
lyrics f526fd9a71 Primer commit 1 rok temu
mediafiles f526fd9a71 Primer commit 1 rok temu
repostajes f526fd9a71 Primer commit 1 rok temu
reymota f526fd9a71 Primer commit 1 rok temu
reymotausers f526fd9a71 Primer commit 1 rok temu
templates f526fd9a71 Primer commit 1 rok temu
README.md f526fd9a71 Primer commit 1 rok temu
manage.py f526fd9a71 Primer commit 1 rok temu
requirements.txt f526fd9a71 Primer commit 1 rok temu

README.md

Instalación

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

python manage.py createsuperuser

python manage.py makemigrations

python manage.py migrate

Comprobar la base de datos

Con la shell entraPsql.sh:

\l para listar las BD

\c reymota para usar nuestra db \dt para ver las tablas

De dónde cogí ideas

https://learndjango.com/tutorials/django-login-and-logout-tutorial

Username: {{ user.username }}

User Full name: {{ user.get_full_name }}

User Group: {{ user.groups.all.0 }}

Email: {{ user.email }}

Session Started at: {{ user.last_login }}

Para funcionar con gunicorn y nginx

https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/

Cambiar la secuencia de lo sid

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.