Planta Milenio is a web-based operations management system built with Django 5 that gives industrial plant teams a single, unified control panel for every activity that happens at the gate and on the floor — from weighing incoming raw-material trucks to tracking which staff members are currently on site. It bridges the gap between a fast local SQLite database and two remote SQL Server instances (the Profit ERP databaseDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JuanDiego3030/Planta_Milenio/llms.txt
Use this file to discover all available pages before exploring further.
AGRBSS_A and the transport database ceres_romana), so that plant-floor decisions are always backed by live ERP and logistics data.
Why Planta Milenio Exists
Industrial plants typically operate with several disconnected tools: paper logs at the security booth, spreadsheets for weighing records, a separate ERP system for purchase orders, and ad-hoc reports generated by different departments. Planta Milenio replaces that fragmented workflow with one coherent application. Every action — a truck entering the yard, a visitor badge being issued, a load being weighed — is recorded in a single database and immediately available for reporting and auditing.Who It Is For
| Role | How they use it |
|---|---|
| Plant operators | Register raw-material truck arrivals, record net weights, and close intake entries |
| Security guards | Log personnel entries and exits, verify vehicle access, and issue visitor passes |
| Logistics coordinators | Query open purchase-order lines from Profit ERP and match them to incoming loads |
| Auditors | Review the complete entry history, export PDF reports, and inspect transport records |
High-Level Architecture
Planta Milenio is a standard Django 5 project that talks to three databases simultaneously:- SQLite (
planta.sqlite3) — the local operational store. Holds Django’s auth tables, the custom user profiles, personnel access logs, and raw-material entry records. No network dependency; always available. - SQL Server
AGRBSS_A— the Profit ERP database. Queried read-only for purchase orders (ordenes,reng_ord) and supplier data that drive the raw-material intake module. - SQL Server
ceres_romana— the transport and logistics database. Provides product catalogues, vehicle registry, driver records, and destination lists used in transport auditing.
The Five Main Modules
Control de Entradas (Raw-Material Intake Control) manages the full lifecycle of a truck visit: arrival registration, tare and gross weighing, net-weight calculation, and printable weight tickets linked to Profit ERP purchase orders. Control de Personas (Personnel Access Control) tracks every person who enters or exits the plant. Security guards record entries and exits with timestamps; the module maintains a live list of who is currently on site. Auditoría (Transport Audit) cross-references transport records fromceres_romana with plant activity. Coordinators can verify that the vehicle, driver, product, and destination on file match what physically arrived.
Reportes (Reports) provides pre-built and filterable reports — by date range, supplier, product, or vehicle — that can be exported to PDF via WeasyPrint.
Gestión de Usuarios (User Management) lets administrators create and configure accounts. Each user has a profile with contact details, a read-only flag, and six independent boolean permission fields, one per module section.
Authentication and Permissions
Planta Milenio uses Django’s session-based authentication. Sessions expire after 1 hour of inactivity (SESSION_COOKIE_AGE = 3600, SESSION_SAVE_EVERY_REQUEST = True), after which the user is redirected to the login page. There is no public registration; all accounts are created by an administrator.
Access to each module is controlled by per-module boolean fields on the user profile rather than Django’s built-in group/permission system. This makes it straightforward for plant administrators — who may not be Django experts — to grant or revoke access to a specific section without navigating the admin interface.
Planta Milenio requires active network connectivity to both SQL Server instances (
AGRBSS_A and ceres_romana) to load purchase-order data, transport records, and product catalogues. If either connection is unavailable, the modules that depend on it will display an error and the affected forms will not function until connectivity is restored.Explore the Documentation
Installation
Clone the repository, set up a Python virtual environment, install dependencies, and start the development server on Windows or Linux.
Configuration
Configure the three database connections, session timeout, timezone, static files, and production security settings in
proyecto/settings.py.User Management
Create accounts with
CreateUser.py, assign per-module permissions, and manage read-only access for auditors.Raw-Material Control
Walk through the full truck intake workflow: arrival registration, dual weighing, net-weight calculation, and PDF weight-ticket generation.