Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AC42027/Backend-produccion/llms.txt

Use this file to discover all available pages before exploring further.

The backend is designed to run on Windows using Waitress as the WSGI server. Before starting the server, you need to prepare a Python virtual environment, install all dependencies, and supply the required runtime configuration through a .env file. This page walks you through each of those steps in order.

Requirements

  • Python 3.13.x — the version used in production. Download from python.org.
  • MySQL server — must be reachable from the host where the backend runs.
  • Git — to clone the repository.

Set up Python and the virtual environment

1

Install Python 3.13.x

Download and install Python 3.13.x from python.org. During installation, check Add Python to PATH.Verify the installation:
python --version
2

Create a virtual environment

From the project root directory, run:
python -m venv venv
3

Activate the virtual environment

On Windows:
venv\Scripts\activate
Your prompt will show (venv) when the environment is active.
4

Install dependencies

pip install -r requirements.txt

Dependencies

The requirements.txt file pins all required packages. The table below explains the purpose of each key dependency.
PackageVersionPurpose
Django5.2Core web framework
djangorestframeworklatestREST API toolkit
django-jazzminlatestCustomised Django admin UI with Goodyear branding
ldap32.9.1LDAP authentication against corporate Active Directory
PyMySQL1.1.1Pure-Python MySQL database connector
python-decouple3.8Reads configuration from .env files and environment variables
django-cors-headers4.7.0Manages Cross-Origin Resource Sharing headers
waitressProduction WSGI server for Windows
gunicorn21.2.0Alternative WSGI server (Linux/macOS)
uvicorn0.35.0ASGI server, included for future async support
asgiref3.8.1ASGI/WSGI compatibility layer used by Django
cryptography44.0.2Required by ldap3 for TLS connections
sqlparse0.5.3SQL formatting used internally by Django
tzdata2025.2Timezone data for USE_TZ support
waitress is not listed in requirements.txt because it is installed separately or assumed to be available in the production environment. Install it explicitly if needed:
pip install waitress

Configure the .env file

The application uses python-decouple to read all sensitive and environment-specific values from a .env file in the project root. Create this file before running any Django commands.
# Django core
SECRET_KEY=change-this-to-a-long-random-string
DEBUG=False
ALLOWED_HOSTS=localhost,127.0.0.1,10.107.202.51
CSRF_TRUSTED_ORIGINS=http://localhost:3010,http://10.107.202.51:3010

# MySQL database
MYSQL_DATABASE=inspecciones
MYSQL_USER=your_db_user
MYSQL_PASSWORD=your_db_password
MYSQL_HOST=192.168.1.100
MYSQL_PORT=3306

# LDAP authentication
LDAP_SERVER=ldap://your-dc.miempresa.local
LDAP_DOMAIN=miempresa.local

# CORS
CORS_ALLOW_ALL_ORIGINS=False
CORS_ALLOWED_ORIGINS=http://localhost:3010,http://10.107.202.51:3010

Variable reference

VariableDescription
SECRET_KEYDjango cryptographic signing key. Must be unique and kept secret.
DEBUGSet to False in production.
ALLOWED_HOSTSComma-separated list of hostnames or IPs the server responds to.
CSRF_TRUSTED_ORIGINSComma-separated list of origins trusted for CSRF validation.
MYSQL_DATABASEName of the MySQL database.
MYSQL_USERMySQL username.
MYSQL_PASSWORDMySQL password.
MYSQL_HOSTIP address or hostname of the MySQL server.
MYSQL_PORTMySQL port, defaults to 3306.
LDAP_SERVERLDAP server URI (e.g. ldap://dc01.miempresa.local).
LDAP_DOMAINActive Directory domain used to build the bind DN.
CORS_ALLOW_ALL_ORIGINSSet to False in production and use CORS_ALLOWED_ORIGINS instead.
CORS_ALLOWED_ORIGINSComma-separated list of allowed frontend origins.
Never commit .env to version control. It contains secrets that grant access to the database, the Django session stack, and the LDAP directory. The repository’s .gitignore already excludes it, but verify this before every push.
Generate a strong SECRET_KEY with Python:
python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"

Build docs developers (and LLMs) love