Gestor de Tareas Django includes a CSV import/export feature designed for situations where you need to load a large set of tasks at once or share your task list with an external tool. You can import tasks by uploading aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/LucPinheiro/gestor-tarea-django/llms.txt
Use this file to discover all available pages before exploring further.
.csv file at /importar/, and you can export tasks as a downloadable tareas.csv file from either the list view or an individual task detail page — with no third-party libraries required.
CSV Format
The importer and exporter both use the same column layout. Your CSV file must include a header row with these column names in any order:| Column | Type | Required on import | Notes |
|---|---|---|---|
id | integer | No | If provided and the ID already exists in the database, the row is skipped |
titulo | string | Yes | Task title, max 100 characters |
descripcion | string | Yes | Full task description |
estado | string | No | Defaults to Borrador if blank or missing |
prioridad | integer | No | Defaults to 1 (Baja) if blank or missing |
fecha_limite | date | No | Format: YYYY-MM-DD; leave blank for no deadline |
fecha_creada | datetime | No | Ignored on import; always set automatically by the database |
Valid field values
- estado
- prioridad
- fecha_limite
| Value | Meaning |
|---|---|
Borrador | Draft (default) |
Pendiente | Pending |
En proceso | In progress |
Completada | Completed |
Sample CSV
The following sample matches the column format expected by the importer. You can use this as a starting template:The
id column is optional when importing. When the id column is present and a Tarea with that ID already exists, the row is silently skipped — the existing record is not updated. To force a re-import, remove the id column or delete the conflicting tasks first.Importing Tasks
The import form is available at/importar/ and requires the user to be logged in.
Navigate to the import page
Click the ⚙ gear menu in the top toolbar (available from both the list and detail views) and select ⬇ Importar registros, or navigate directly to
/importar/.Select your CSV file
Click Selecciona un archivo CSV and choose a
.csv file from your local machine. The file field maps to the archivo_csv input in the multipart/form-data form.Submit the form
Click Importar. The server reads the uploaded file, decodes it, and processes each row.
Review the result messages
After processing, the app redirects to the list view and displays summary messages using Django’s messages framework:
Rows that raised an exception during
| Outcome | Message shown |
|---|---|
| Tasks imported successfully | Se importaron correctamente N tareas. |
| All rows already existed | No se importaron tareas nuevas porque ya existen en el sistema. |
Tarea.objects.create() are counted as errors and silently skipped. Check that your estado and prioridad values are valid if you see fewer imports than expected.How the importer processes each row
Theimportar_csv view applies this logic for every row in the file:
fecha_creada) are set automatically by the database.
Exporting Tasks
The export endpoint at/exportar/ returns a file download response with Content-Disposition: attachment; filename="tareas.csv". It supports three modes depending on how it is called.
Export selected tasks from the list view
In the list view (/tareas/?vista=lista), tick the checkboxes next to the tasks you want to export, then open the ⚙ gear menu and click ⬆ Exportar CSV. The form POSTs to /exportar/ with the selected IDs as tareas_seleccionadas values.
estado.
Export all tasks (no selection)
Trigger an export with no selected IDs to download the complete task list:Export a single task from the detail view
From a task detail page, open the ⚙ gear menu and click ↥ Exportar CSV. This sends aGET request with the task ID as a query parameter:
Export column order
Regardless of the export mode, every exported file uses this fixed column order:fecha_creada column contains only the date portion (no time component) in YYYY-MM-DD format, produced by calling .date() on the DateTimeField value.