All runtime configuration for Planta Milenio lives inDocumentation 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.
proyecto/settings.py. This file controls how Django connects to the three databases, how long user sessions last, which timezone is used for timestamps, where static assets are served from, and the security posture of the deployment. The sections below document each configuration area and explain why each setting exists.
Database Configuration
Planta Milenio uses three simultaneous database connections managed through Django’s multi-database routing system. Thedefault connection handles all writes and stores application state locally; the two SQL Server connections are used exclusively for reads from external ERP and logistics systems.
default — SQLite
The default database is a local SQLite file (planta.sqlite3) created in the Django project root directory (BASE_DIR). It stores:
- Custom user profiles — usernames, hashed passwords, contact details, per-module permission flags, and read-only mode settings
- Historial de entradas — the complete raw-material intake log: truck arrivals, weights, timestamps, and associated purchase-order references
- Acceso de personas — the personnel entry/exit log maintained by the security module
sqlserver — Profit ERP (AGRBSS_A)
The sqlserver connection targets the AGRBSS_A database on the company’s SQL Server instance. This is the Profit ERP database. Planta Milenio queries it read-only for:
ordenes— purchase orders used to validate and link incoming raw-material truck loadsreng_ord— purchase-order line items (renglones de orden) providing product codes, quantities, and units
<sql-server-host> with the hostname or IP address of the SQL Server machine, and <your-password> with the password for the profit SQL Server login. The OPTIONS block instructs pyodbc to use the FreeTDS driver with TDS protocol version 7.4, which is compatible with SQL Server 2008 R2 and later.
On Windows, replace 'driver': 'FreeTDS' with 'driver': 'ODBC Driver 17 for SQL Server' (or whichever version of the Microsoft ODBC Driver is installed) and remove the tds_version and host_is_server keys, as they are FreeTDS-specific.
ceres_romana — Transport and Logistics
The ceres_romana connection targets the ceres_romana database on the same or a different SQL Server host. It supplies the reference data for the transport auditing module:
- Product catalogue — the list of products that can be transported
- Vehicle registry — plate numbers and vehicle types
- Driver records — driver names and licence information
- Destination catalogue — authorized destination points for outbound loads
USER, PASSWORD, HOST, and OPTIONS follow the same pattern as the sqlserver entry above.
Session Settings
Planta Milenio enforces a 1-hour inactivity timeout on all sessions. Two settings work together to implement this:SESSION_COOKIE_AGE sets the maximum lifetime of a session cookie in seconds. With SESSION_SAVE_EVERY_REQUEST = True, Django updates the cookie’s expiry timestamp on every request, so the clock resets each time the user interacts with the application. A session only expires after the user has been completely idle for a full hour.
When a session expires, the user is automatically redirected to the login page. No data is lost — only the authentication state is cleared.
Timezone and Language
Planta Milenio is configured for Venezuelan Spanish:TIME_ZONE = 'America/Caracas' ensures that all timestamps stored in SQLite and displayed in the interface reflect Venezuela Standard Time (UTC−4). This is important for the intake log and personnel access records, where the exact local time of an event matters for auditing purposes.
LANGUAGE_CODE = 'es-ve' sets Venezuelan Spanish as the locale, which affects Django’s built-in form validation messages, date formatting, and number formatting throughout the application.
Static Files
CSS stylesheets, JavaScript files, and images are served from theassets/ directory at the project root:
STATICFILES_DIRS tells Django where to look for static files when running collectstatic or when serving them directly in development mode. All front-end assets — custom styles, plant logos, icon sets — live under assets/.
STATIC_ROOT is the output directory that collectstatic writes to. It must be different from every directory listed in STATICFILES_DIRS. MEDIA_ROOT is the upload destination for any user-uploaded files (such as profile images).
In production, run python manage.py collectstatic to copy all static files into STATIC_ROOT, then configure your web server (Nginx, Apache) to serve that directory directly. Never serve static files through the Django process in production.
Security Settings for Production
The following settings must be reviewed and updated before deploying Planta Milenio to a server accessible by more than one developer machine:| Setting | Development value | Production recommendation |
|---|---|---|
DEBUG | True | False |
SECRET_KEY | Hardcoded string in repo | Long random string, loaded from an environment variable |
ALLOWED_HOSTS | ['*'] or ['localhost'] | Exact server IP or hostname |
DJANGO_SECRET_KEY environment variable on the production host through your process manager (systemd unit file, Docker environment, etc.) and the fallback value will only ever be used in local development.