diff --git a/RepostajesDj/K8S/Makefile b/RepostajesDj/K8S/Makefile
index c154379..ffb83fc 100644
--- a/RepostajesDj/K8S/Makefile
+++ b/RepostajesDj/K8S/Makefile
@@ -1,6 +1,6 @@
export ARQUITECTURA := $(shell lscpu |grep itectur | tr -d ' '| cut -f2 -d':')
-export IMG_VERSION = 1.43
-export IMG_NGINX_VERSION = 1.17
+export IMG_VERSION = 0.9
+export IMG_NGINX_VERSION = 1.0
# limpia todo
all: imagen nginx clean install
@@ -14,22 +14,22 @@ install:
-kubectl create -f env-prod-configmap.yaml
-kubectl create -f env-prod-db-configmap.yaml
- -kubectl create -f pv-local-libros.yaml
- -kubectl create -f libros-prod-persistentvolumeclaim.yaml
+ -kubectl create -f pv-local-vehiculos.yaml
+ -kubectl create -f vehiculos-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 < libros-deployment.yaml |kubectl create -f -
+ -envsubst < vehiculos-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 < libros-deployment.yaml |kubectl delete -f -
+ -envsubst < vehiculos-deployment.yaml |kubectl delete -f -
-kubectl delete -f db-deployment.yaml
-kubectl delete -f db-service.yaml
@@ -39,8 +39,8 @@ clean:
-kubectl delete -f postgres-data-persistentvolumeclaim.yaml
-kubectl delete -f static-volume-persistentvolumeclaim.yaml
- -kubectl delete -f libros-prod-persistentvolumeclaim.yaml
- -kubectl delete -f pv-local-libros.yaml
+ -kubectl delete -f vehiculos-prod-persistentvolumeclaim.yaml
+ -kubectl delete -f pv-local-vehiculos.yaml
-kubectl delete -f reg-secret.yaml
-kubectl delete -f namespace.yaml
diff --git a/RepostajesDj/requirements.txt b/RepostajesDj/requirements.txt
index 4c99c68..9303601 100644
--- a/RepostajesDj/requirements.txt
+++ b/RepostajesDj/requirements.txt
@@ -1,4 +1,12 @@
asgiref==3.8.1
-Django==5.1
+Django==4.2
+flake8==7.1.1
+gunicorn==22.0.0
+mccabe==0.7.0
+packaging==24.1
+pillow==10.4.0
+psycopg2-binary==2.9.6
+pycodestyle==2.12.1
+pyflakes==3.2.0
sqlparse==0.5.1
typing_extensions==4.12.2
diff --git a/RepostajesDj/vehiculos/repostajes/admin.py b/RepostajesDj/vehiculos/repostajes/admin.py
index 6593c20..955f3cd 100644
--- a/RepostajesDj/vehiculos/repostajes/admin.py
+++ b/RepostajesDj/vehiculos/repostajes/admin.py
@@ -4,11 +4,12 @@ from django.contrib.auth.admin import UserAdmin
# Register your models here.
-from .models import Vehiculos, Repostajes, ReyMotaUser
+from .models import Vehiculo, Repostaje, ReyMotaUser
from .forms import ReyMotaUserCreationForm, ReyMotaUserChangeForm
-admin.site.register(Vehiculos)
-admin.site.register(Repostajes)
+admin.site.register(Vehiculo)
+admin.site.register(Repostaje)
+
class ReyMotaUserAdmin(UserAdmin):
add_form = ReyMotaUserCreationForm
diff --git a/RepostajesDj/vehiculos/repostajes/forms.py b/RepostajesDj/vehiculos/repostajes/forms.py
index 8497008..4cdfdb7 100644
--- a/RepostajesDj/vehiculos/repostajes/forms.py
+++ b/RepostajesDj/vehiculos/repostajes/forms.py
@@ -22,7 +22,7 @@ class RepostajeForm(forms.ModelForm):
model = Repostaje
fields = ['fecha', 'kms', 'litros', 'descuento']
- fecha = forms.DateFieldField(
+ fecha = forms.DateField(
widget=forms.TextInput(attrs={'class': 'form-control'}))
kms = forms.DecimalField(
widget=forms.TextInput(attrs={'class': 'form-control'}))
diff --git a/RepostajesDj/vehiculos/repostajes/models.py b/RepostajesDj/vehiculos/repostajes/models.py
index 3665507..a65f628 100644
--- a/RepostajesDj/vehiculos/repostajes/models.py
+++ b/RepostajesDj/vehiculos/repostajes/models.py
@@ -28,13 +28,13 @@ class Vehiculo(models.Model):
class Repostaje(models.Model):
vehiculo = models.ForeignKey(Vehiculo, on_delete=models.CASCADE)
fecha = models.DateField()
- kms = models.DecimalField(blank=True, null=True)
- litros = models.DecimalField(blank=True, null=True)
- descuento = models.DecimalField(blank=True, null=True)
- precioxlitro = models.DecimalField(blank=True, null=True)
- kmsrecorridos = models.DecimalField(blank=True, null=True)
- consumo = models.DecimalField(blank=True, null=True)
-
+ kms = models.DecimalField(max_digits=10, decimal_places=2, blank=True, null=True)
+ litros = models.DecimalField(max_digits=4, decimal_places=2, blank=True, null=True)
+ descuento = models.DecimalField(max_digits=4, decimal_places=2, blank=True, null=True)
+ precioxlitro = models.DecimalField(max_digits=4, decimal_places=2, blank=True, null=True)
+ kmsrecorridos = models.DecimalField(max_digits=5, decimal_places=2, blank=True, null=True)
+ consumo = models.DecimalField(max_digits=4, decimal_places=2, blank=True, null=True)
+
def __str__(self):
return self.fecha
diff --git a/RepostajesDj/vehiculos/repostajes/templates/_cabecera.html b/RepostajesDj/vehiculos/repostajes/templates/_cabecera.html
index 09c071f..47f0803 100644
--- a/RepostajesDj/vehiculos/repostajes/templates/_cabecera.html
+++ b/RepostajesDj/vehiculos/repostajes/templates/_cabecera.html
@@ -103,7 +103,7 @@