Before anyone can log in to Planta Milenio, at least oneDocumentation 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.
User_admin record must exist in the database. Because the web panel itself requires a logged-in user to operate, the first account must always be created from the command line using CreateUser.py. Subsequent accounts can be created either via the CLI or through the web panel at /usuarios/.
Via CLI (CreateUser.py)
CreateUser.py is an interactive script located at the project root. It configures Django’s settings module, calls django.setup(), and then provides a three-option menu for managing users without a running server.
Running the script
- 1 · Register new user
- 2 · Change password
- 3 · Exit
Selecting option The script validates the inputs before saving:The script validates the inputs: empty
1 walks through the full registration flow:nombre or password prints [ERROR] Nombre y contraseña son obligatorios. and returns to the menu. A duplicate nombre or email prints the corresponding [ERROR] message and aborts. The solo_consulta prompt only accepts s or n; any other input loops with an error message.Password hashing
All passwords are hashed using Django’smake_password function before being stored:
check_password(plain, hashed), which supports this format transparently.
Permission flags (
permiso_control, permiso_control_personas, etc.) default to False for users created via CreateUser.py. After registering the first user, log in through the web panel and use the Gestión de Usuarios interface to assign the specific module permissions that account needs.Via Web Panel (/usuarios/)
Once at least one user with permiso_usuarios = True exists, all subsequent user management can be done through the browser-based panel at /usuarios/.
Navigate to /usuarios/
Log in and click the Usuarios section in the navigation menu. Access requires
permiso_usuarios = True on the authenticated account. Without it, the view redirects to the login page with an access-denied message.Create a new user
Click the Crear usuario button to open the creation form. Fill in the required fields (
nombre, password) and any optional fields (email, telefono). Toggle the desired permission flags and the solo_consulta / bloqueado checkboxes, then submit the form.Edit an existing user
Each row in the user list includes an Edit action. The edit form pre-populates all current values. Leave the password field empty to keep the existing password unchanged — only populate it to set a new one.
nombre) and paginates at 10 records per page.
Validation rules (web panel)
Thecontrol_usuarios view enforces the following before calling ControlUsuarios.crear_usuario():
| Rule | Behaviour on failure |
|---|---|
nombre is required | Error: “Nombre y contraseña son obligatorios.” |
password is required on create | Error: “Nombre y contraseña son obligatorios.” |
nombre must be unique | Database raises IntegrityError; displayed as “Error al crear usuario: …” |
email must be unique if provided | Database raises IntegrityError; displayed as “Error al crear usuario: …” |
Read-only users and the web panel
Asolo_consulta user who also has permiso_usuarios = True can open /usuarios/ and browse the user list. However, any attempt to submit the Create, Edit, or Delete forms is blocked at the view level before touching the database:
/usuarios/ with this error message after every blocked POST.