Hello every one hope you have a great day,
i was working on an e-commerce app and one feature is sending emails on every order update so i used my email for testing and this thing worked
EMAIL_BACKEND = “django.core.mail.backends.smtp.EmailBackend”
EMAIL_PORT = 587
EMAIL_USE_TLS = True
DEFAULT_FROM_EMAIL= os.getenv(“ADMIN_EMAIL”)
EMAIL_HOST = ‘smtp.gmail.com’
EMAIL_HOST_USER = DEFAULT_FROM_EMAIL
here’s the email settings
and when i tried this project on a mono-repo to prepare for deployment i used docker and docker-compose
the issue is when i tried to build this on my local machine every thing worked well and nothin un expected happened
when i tried to build it on another machine using the same githup repo and the same docker files the emails can’t be sent and i got an error like this printed on the console
[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1010)
i this only appears when the website is built on another laptop
Here’s the docker file if you are wondering
syntax=docker/dockerfile:1
FROM python:3.12-slim
# Prevents Python from writing .pyc files and enables unbuffered stdout/stderr
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /app
# Install system dependencies for psycopg2
RUN apt-get update && \
apt-get install -y --no-install-recommends gcc libpq-dev && \\
rm -rf /var/lib/apt/lists/\*
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy project files
COPY . .
# Copy and prepare entrypoint script
COPY entrypoint.sh /entrypoint.sh
RUN sed -i ‘s/\r$//’ /entrypoint.sh && chmod +x /entrypoint.sh
# Create media directory
RUN mkdir -p /app/media
EXPOSE 8000
ENTRYPOINT [“/entrypoint.sh”]
i hope you might help me with this one because i was struggling with it since it’s my first production app and i want it to get ready for deployment