The Inspecciones Técnicas backend is a Django REST API that runs on Python 3.13 and connects to a MySQL database. This guide walks you through cloning the repository, installing dependencies, configuring your environment, and making your first authenticated request against a live server.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.
Create and activate a virtual environment
Create an isolated Python environment so that project dependencies do not conflict with system packages:
Install dependencies
Install all required packages from Key packages installed include Django 5.2, Django REST Framework, PyMySQL, ldap3, python-decouple, django-cors-headers, and Waitress.
requirements.txt:Create the .env file
The backend reads all sensitive configuration from a
.env file in the project root. Create this file before running migrations or starting the server.See Configuration for a full reference of every variable. A minimal working example:.env
Run database migrations
Apply Django’s migrations to create the required tables in your MySQL database:
Run
makemigrations only when starting from a fresh clone or after model changes. For an existing database with the schema already applied, migrate alone is sufficient.Make your first API requests
With the server running, authenticate with your LDAP credentials and then call a data endpoint. The examples below use port8080 (Waitress/production). If you are running the Django dev server, replace 8080 with 8000.
Step 1: Authenticate via LDAP
Send your corporate username and password to/api/login-ldap/. A successful response sets a session cookie that you must include in subsequent requests.
Step 2: Fetch the equipment list
Use the saved session cookie to call a protected endpoint:Available endpoints
The following routes are registered in the API:| Method | Path | Description |
|---|---|---|
POST | /api/login-ldap/ | Authenticate with LDAP credentials |
GET | /api/logout/ | End the current session |
GET | /api/equipos/ | List all equipment |
GET | /api/equipo/<id>/ | Get a single equipment record |
GET | /api/divisiones/ | List divisions |
GET | /api/areas/ | List areas |
GET | /api/zonas/ | List zones |
GET | /api/categorias/ | List inspection categories |
GET | /api/preguntas/<category>/ | Get questions for a category |
POST | /api/guardar/ | Submit a completed inspection |
GET | /api/asignaciones/ | List weekly technician assignments |
GET | /api/dashboard/inspecciones/ | Retrieve all inspections for the dashboard |
Access to most endpoints is restricted to requests from authorized IP ranges or registered hostnames. See IP Restrictions for the full policy. The dashboard endpoint (
/api/dashboard/inspecciones/) is exempt from IP restrictions.