feat: remove unused images and update email functionality

- Deleted multiple unused image files from the static media directory.
- Enhanced email sending functionality by adding a new method `send_hemail` for sending HTML emails.
- Updated the `enviar_correo_bienvenida` task to use the new HTML email method.
- Added a new RGPD (General Data Protection Regulation) privacy policy page template.
- Updated URL routing to include the new RGPD page.
- Added a view function for rendering the RGPD page.
This commit is contained in:
2026-03-20 09:18:02 +01:00
parent 2439916d14
commit 351c9cd955
95 changed files with 163 additions and 4 deletions
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 985 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 985 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 985 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 985 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 535 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 535 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 535 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 384 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 303 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 303 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 303 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 411 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 411 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 411 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 300 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 320 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

+10 -2
View File
@@ -1,13 +1,21 @@
from celery import shared_task
from django.conf import settings
from .utilities import send_email
from django.template.loader import render_to_string
from .utilities import send_email, send_hemail
from .vars import login_message, verify_message
import random, string
from .models import User, VerificationCode
@shared_task
def enviar_correo_bienvenida(email_usuario: str, nombre_usuario: str):
send_email(email_usuario, "Inicio de Sesión correcto", login_message.format(name = nombre_usuario))
html_content = render_to_string(
'emails/welcome.html',
{
"name": nombre_usuario
},
using='jinja2'
)
send_hemail(email_usuario, "Inicio de Sesión correcto", html_content, "Has iniciado sesión...")
@shared_task
def enviar_correo_confirmacion(usuario: User):
+64
View File
@@ -0,0 +1,64 @@
{% load static %}
{% extends "tienda/base.html" %}
{% block content %}
<div class="row">
<div class="col-md-12">
<article class="legal-container">
<h1>Política de Privacidad (RGPD)</h1>
<p>La presente Política de Privacidad establece los términos en que <strong>{{ nombre_tienda|default:"[Nombre de tu Tienda]" }}</strong> usa y protege la información proporcionada por sus usuarios en el marco de nuestro e-commerce local en Almería.</p>
<section class="legal-section">
<h2>1. Responsable del Tratamiento</h2>
<p>Los datos recabados a través de esta web son responsabilidad de:</p>
<address>
<strong>Identidad:</strong> Comercialmeria<br>
<strong>NIF/CIF:</strong> [00000000X]<br>
<strong>Dirección:</strong> (Dirección de la empresa)<br>
<strong>Email:</strong> <a href="mailto:info@tuweb.com">example@example.com</a>
</address>
</section>
<section class="legal-section">
<h2>2. Información que Recopilamos</h2>
<p>Para procesar pedidos y consultas en Almería y provincia, solicitamos:</p>
<ul>
<li><strong>Datos identificativos:</strong> Nombre, apellidos y DNI (para facturación).</li>
<li><strong>Contacto:</strong> Email y teléfono.</li>
<li><strong>Logística:</strong> Dirección de envío en Almería o resto de España.</li>
</ul>
</section>
<section class="legal-section">
<h2>3. Finalidad y Legitimación</h2>
<p>Tratamos sus datos para:</p>
<ul>
<li><strong>Gestión contractual:</strong> Tramitar compras y envíos (Base: Ejecución de contrato).</li>
<li><strong>Atención al cliente:</strong> Responder dudas vía formulario (Base: Interés legítimo).</li>
<li><strong>Newsletter:</strong> Información sobre productos locales (Base: Consentimiento explícito).</li>
</ul>
</section>
<section class="legal-section">
<h2>4. Conservación y Destinatarios</h2>
<p>Los datos se conservarán mientras dure la relación comercial y durante los plazos legales (generalmente 6 años por normativa contable). Solo se comunicarán datos a:</p>
<ul>
<li>Agencias de transporte para la entrega del producto.</li>
<li>Administración Tributaria para el cumplimiento de obligaciones fiscales.</li>
<li>Entidades bancarias para el cobro de los pedidos.</li>
</ul>
</section>
<section class="legal-section">
<h2>5. Sus Derechos</h2>
<p>Como usuario, puede ejercer sus derechos de acceso, rectificación, supresión, limitación y oposición enviando un correo a <strong>[correo@tuweb.com]</strong>, adjuntando prueba de identidad.</p>
</section>
<footer class="legal-footer">
<p><small>Última actualización: Marzo 2026. Documentación para Proyecto Final DAW.</small></p>
</footer>
</article>
</div>
</div>
{% endblock %}
+2 -1
View File
@@ -44,5 +44,6 @@ urlpatterns = [
path("usuario/direcciones/<int:id>/editar/", views.editar_direccion, name="editar_direccion"),
path("usuario/direcciones/<int:id>/eliminar/", views.eliminar_direccion, name="eliminar_direccion"),
path("usuario/mensajes/", views.mensajes_comprador, name="mensajes_comprador"),
path("verify/<str:code>", views.verify, name="verify")
path("verify/<str:code>", views.verify, name="verify"),
path("rgpd", views.rgpd, name="rgpd")
]
+17
View File
@@ -39,6 +39,23 @@ def send_email(dest: str, title: str, body: str):
fail_silently=False,
)
logger.info("EMAIL_SENT to=%s subject=%s", dest, title)
return (True,)
except Exception as e:
logger.exception("EMAIL_SEND_FAILED to=%s subject=%s error=%s", dest, title, str(e))
return (False, e)
def send_hemail(dest: str, title: str, body: str, nbody: str):
try:
send_mail(
subject=title,
html_message=body,
from_email=settings.DEFAULT_FROM_EMAIL,
recipient_list=[dest],
fail_silently=False,
message=nbody
)
logger.info("EMAIL_SENT to=%s subject=%s", dest, title)
return (True,)
except Exception as e:
+4 -1
View File
@@ -1253,4 +1253,7 @@ def reset_password(request: HttpRequest):
return redirect("index")
return render(request, "tienda/reset_password", {})
return render(request, "tienda/reset_password", {})
def rgpd(request: HttpRequest):
return render(request, "tienda/rgpd.html", {})