|
@@ -44,51 +44,55 @@ Se hace desde el yaml
|
|
|
oc create -f postgresql-deployment.yaml
|
|
oc create -f postgresql-deployment.yaml
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+## Modificaciones al código
|
|
|
|
|
|
|
|
|
|
+Una vez realizadas las modificaciones al código y se hayan subido a gitea, hay que reconstruir el proyecto.
|
|
|
|
|
|
|
|
|
|
+ oc start-build reymota
|
|
|
|
|
|
|
|
|
|
+## Comandos a ejecutar la primera vez o cuando haya cambios en las bases de datos
|
|
|
|
|
|
|
|
|
|
+ python manage.py createsuperuser
|
|
|
|
|
|
|
|
-python manage.py createsuperuser
|
|
|
|
|
|
|
|
|
|
|
|
+ python manage.py makemigrations
|
|
|
|
|
|
|
|
-python manage.py makemigrations
|
|
|
|
|
-
|
|
|
|
|
-python manage.py migrate
|
|
|
|
|
|
|
+ python manage.py migrate
|
|
|
|
|
|
|
|
## Comprobar la base de datos
|
|
## Comprobar la base de datos
|
|
|
|
|
|
|
|
Con la shell entraPsql.sh:
|
|
Con la shell entraPsql.sh:
|
|
|
|
|
|
|
|
-\l para listar las BD
|
|
|
|
|
|
|
+ \l para listar las BD
|
|
|
|
|
|
|
|
-\c reymota para usar nuestra db
|
|
|
|
|
-\dt para ver las tablas
|
|
|
|
|
|
|
+ \c reymota para usar nuestra db
|
|
|
|
|
+ \dt para ver las tablas
|
|
|
|
|
|
|
|
# De dónde cogí ideas
|
|
# De dónde cogí ideas
|
|
|
|
|
|
|
|
-https://learndjango.com/tutorials/django-login-and-logout-tutorial
|
|
|
|
|
|
|
+ https://learndjango.com/tutorials/django-login-and-logout-tutorial
|
|
|
|
|
|
|
|
|
|
|
|
|
-Username: {{ user.username }}
|
|
|
|
|
|
|
+ Username: {{ user.username }}
|
|
|
|
|
|
|
|
-User Full name: {{ user.get_full_name }}
|
|
|
|
|
|
|
+ User Full name: {{ user.get_full_name }}
|
|
|
|
|
|
|
|
-User Group: {{ user.groups.all.0 }}
|
|
|
|
|
|
|
+ User Group: {{ user.groups.all.0 }}
|
|
|
|
|
|
|
|
-Email: {{ user.email }}
|
|
|
|
|
|
|
+ Email: {{ user.email }}
|
|
|
|
|
|
|
|
-Session Started at: {{ user.last_login }}
|
|
|
|
|
|
|
+ Session Started at: {{ user.last_login }}
|
|
|
|
|
|
|
|
|
|
|
|
|
## Para funcionar con gunicorn y nginx
|
|
## Para funcionar con gunicorn y nginx
|
|
|
-https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/
|
|
|
|
|
|
|
+
|
|
|
|
|
+ https://testdriven.io/blog/dockerizing-django-with-postgres-gunicorn-and-nginx/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## Cambiar la secuencia de lo sid
|
|
## Cambiar la secuencia de lo sid
|
|
|
|
|
|
|
|
-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.
|
|
|
|
|
|