diff --git a/.env.example b/.env.example
index 4d717ca..9fb78ce 100644
--- a/.env.example
+++ b/.env.example
@@ -1,3 +1,4 @@
API_KEY_8080=secret8080
API_KEY_8081=secret8081
API_KEY_8082=secret8082
+DATABASE_URL=postgres://mi_usuario:mi_password_seguro@db:5432/joinproject_db
\ No newline at end of file
diff --git a/.github/scripts/depth_conditional_nesting_GP.py b/.github/scripts/depth_conditional_nesting_GP.py
index d76f147..202727e 100644
--- a/.github/scripts/depth_conditional_nesting_GP.py
+++ b/.github/scripts/depth_conditional_nesting_GP.py
@@ -85,10 +85,10 @@ def visit_If(self, node: ast.If) -> None:
def get_status_code(max_depth: int) -> str:
if max_depth > CRITICAL_THRESHOLD:
- return "❌ CRITICAL"
+ return "CRITICAL"
if max_depth >= WARNING_THRESHOLD:
- return "🚨 WARNING"
- return "✅ OK"
+ return "WARNING"
+ return "OK"
def get_metrics(filepath: Path) -> Optional[Dict[str, Any]]:
@@ -144,7 +144,7 @@ def main() -> None:
all_results.append({
"file": str(filepath),
"avg_depth": metrics["avg"],
- "max_depth": metrics["max"],
+ "max_nesting_depth": metrics["max"],
"status_code": metrics["status_code"]
})
if metrics["max"] > CRITICAL_THRESHOLD:
diff --git a/.github/scripts/fog_comments_indexGP.py b/.github/scripts/fog_comments_indexGP.py
index fcd9358..0c4cf57 100644
--- a/.github/scripts/fog_comments_indexGP.py
+++ b/.github/scripts/fog_comments_indexGP.py
@@ -1,12 +1,10 @@
-import re
-import os
-import sys
-import json
-import textstat
+import re, os, sys, json, textstat
from pathlib import Path
SUPPORTED_EXTENSIONS = {'.py', '.js', '.ts', '.cpp', '.java', '.html'}
+EXCLUDE_DIRS = {'.git', 'node_modules', 'venv', 'env', '__pycache__', 'dist'}
+
def extract_comments(file_path):
extension = os.path.splitext(file_path)[1]
@@ -75,7 +73,7 @@ def scan(target_path):
files = (
[path] if path.is_file()
- else [f for f in path.rglob('*') if f.suffix in SUPPORTED_EXTENSIONS]
+ else [f for f in path.rglob('*') if f.suffix in SUPPORTED_EXTENSIONS and not any(part in EXCLUDE_DIRS for part in f.parts)]
)
results = []
@@ -92,7 +90,7 @@ def scan(target_path):
results.append({
"file": str(file),
"avg_fog": round(avg, 1) if avg else None,
- "max_fog": round(max_score, 1) if max_score else None,
+ "fog_score": round(max_score, 1) if max_score else None,
"status_code": status
})
diff --git a/.github/scripts/render-integrity-html.js b/.github/scripts/render-integrity-html.js
index 254b8f9..e2e70f8 100644
--- a/.github/scripts/render-integrity-html.js
+++ b/.github/scripts/render-integrity-html.js
@@ -164,7 +164,7 @@ function buildQualitySection(key, data) {
const results = data.results || []
const totalFiles = (data.summary && data.summary.total_files != null) ? data.summary.total_files : results.length
- const violations = results.filter((r) => r.status_code !== 'OK' && r.status_code !== 'OK!')
+ const violations = results.filter((r) => r.status_code !== 'OK' && r.status_code !== 'OK!' && r.status_code !== 'NO DATA')
const passed = totalFiles - violations.length
const findingsHtml = violations.length === 0
@@ -172,7 +172,7 @@ function buildQualitySection(key, data) {
: violations.map((r) => {
const val = r[qm.metric]
const display = typeof val === 'number' ? val.toFixed(qm.decimals) : (val ?? '?')
- const lvl = (r.status_code === 'DANGER' || r.status_code === '⚠️ IMPROVE NAMING') ? 'error' : 'warning'
+ const lvl = (r.status_code === 'DANGER' || r.status_code === '⚠️ IMPROVE NAMING' || r.status_code === 'COMPLEX') ? 'error' : 'warning'
return `
${chip(lvl)}
@@ -225,7 +225,7 @@ const qualitySummaryRows = quality
const qm = QUALITY_META[key]
const data = quality[key]
const status = qualityJobStatus(data)
- const violations = data ? (data.results || []).filter((r) => r.status_code !== 'OK' && r.status_code !== 'OK!').length : 0
+ const violations = data ? (data.results || []).filter((r) => r.status_code !== 'OK' && r.status_code !== 'OK!' && r.status_code !== 'NO DATA').length : 0
return `
${qm.icon} ${esc(qm.name)}
diff --git a/.github/workflows/quality-pipeline.yml b/.github/workflows/quality-pipeline.yml
index 224ffbc..5aaadf7 100644
--- a/.github/workflows/quality-pipeline.yml
+++ b/.github/workflows/quality-pipeline.yml
@@ -328,7 +328,7 @@ jobs:
- name: Run fog index analysis
run: |
mkdir -p quality-job4
- python .github/scripts/fog_comments_indexGP.py src/ \
+ python .github/scripts/fog_comments_indexGP.py . \
> quality-job4/fog-results.json
cat quality-job4/fog-results.json
diff --git a/.gitignore b/.gitignore
index 53487e7..c139f97 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,4 +14,4 @@ db.sqlite3
media/
env/
staticfiles/
-
+.vscode/
diff --git a/Dockerfile b/Dockerfile
index f1728a7..765eebd 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,10 +1,10 @@
-FROM python:3.13-slim
+FROM python:3.12-slim
WORKDIR /app
COPY ./requirements.txt /app/
-RUN pip install -r requirements.txt
+RUN pip install --upgrade pip && pip install -r requirements.txt
COPY . .
@@ -12,7 +12,4 @@ EXPOSE 8000
RUN python manage.py collectstatic --noinput
-CMD python3 manage.py migrate && python3 manage.py runserver 0.0.0.0:8000
-
-
-
+CMD python3 manage.py migrate --fake-initial && gunicorn web.wsgi:application --bind 0.0.0.0:${PORT:-8000} --timeout 90
\ No newline at end of file
diff --git a/Templates/Details/details_base.html b/Templates/Details/details_base.html
index 6258c36..35465f0 100644
--- a/Templates/Details/details_base.html
+++ b/Templates/Details/details_base.html
@@ -1,5 +1,6 @@
{% extends 'base.html' %}
{% load static %}
+{% load i18n %}
{% block extra_css %}
@@ -8,91 +9,190 @@
{% block content %}
- Sinopsis
+ {% trans "Sinopsis" %}
- {{ content.synopsis|default:"No hay una descripción disponible." }}
+ {% if content.synopsis %}{{ content.synopsis }}{% else %}{% trans "No hay una descripción disponible." %}{% endif %}
{% block extra_main_content %}{% endblock %}
- Acciones
+ {% trans "Acciones" %}
{% if user.is_authenticated %}
-
- {% if is_favorite %} Dejar de seguir {% else %} Seguir {% endif %}
+ {% if is_favorite %} {% trans "Dejar de seguir" %} {% else %} {% trans "Seguir" %} {% endif %}
{% endif %}
+
+
+✅ {% trans "Añadido a tu historial" %}
+
{% endblock %}
\ No newline at end of file
diff --git a/Templates/Details/details_movie.html b/Templates/Details/details_movie.html
index 4b0c5ba..4a38067 100644
--- a/Templates/Details/details_movie.html
+++ b/Templates/Details/details_movie.html
@@ -1,10 +1,33 @@
{% extends 'Details/details_base.html' %}
+{% load i18n %}
{% block content_metadata %}
-
Lanzamiento
+
{% trans "Lanzamiento" %}
{{ content.year }}
{% endblock %}
-{% block favorite_url %}{% url 'toggle_movie_favorite' content.id %}{% endblock %}
\ No newline at end of file
+{% block favorite_url %}{% url 'toggle_movie_favorite' content.id %}{% endblock %}
+
+{% block extra_main_content %}
+
+
{% trans "También te puede gustar..." %}
+
+
+{% endblock %}
\ No newline at end of file
diff --git a/Templates/Details/details_serie.html b/Templates/Details/details_serie.html
index 20c9bc5..9eaa8e6 100644
--- a/Templates/Details/details_serie.html
+++ b/Templates/Details/details_serie.html
@@ -1,17 +1,18 @@
{% extends 'Details/details_base.html' %}
+{% load i18n %}
{% block content_metadata %}
-
Periodo
+
{% trans "Periodo" %}
- {{ content.start_year }} - {{ content.end_year|default:"Actualidad" }}
+ {{ content.start_year }} - {% if content.end_year %}{{ content.end_year }}{% else %}{% trans "Actualidad" %}{% endif %}
{% if content.total_seasons %}
-
Temporadas
-
{{ content.total_seasons }} Seasons
+
{% trans "Temporadas" %}
+
{{ content.total_seasons }} {% trans "Temporadas" %}
{% endif %}
{% endblock %}
diff --git a/Templates/base.html b/Templates/base.html
index c7f5a31..9f42415 100644
--- a/Templates/base.html
+++ b/Templates/base.html
@@ -32,8 +32,6 @@
{% if user.is_authenticated %}
{% trans "Welcome" %} {{ user.username }}
{% endif %}
-
-