Skip to main content

Documentation 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.

All URL patterns for Gestor de Tareas Django are declared in a single file: mi_proyecto/urls.py. The project uses Django’s path() router and mixes custom view functions (imported from tareas.views) with Django’s built-in class-based LoginView and LogoutView from django.contrib.auth. Authenticated routes enforce login via the @login_required decorator in the view layer; unauthenticated requests are redirected to LOGIN_URL = 'login' (i.e., /).

URL Configuration

mi_proyecto/urls.py
from django.contrib import admin
from django.urls import path
from tareas import views
from django.contrib.auth import views as auth_views

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', auth_views.LoginView.as_view(
        template_name='tareas/login.html'
    ), name='login'),
    path('tareas/', views.lista_tareas, name='lista_tareas'),
    path('crear/', views.crear_tarea, name='crear_tarea'),
    path('editar/<int:id>/', views.editar_tarea, name='editar_tarea'),
    path('eliminar/<int:id>/', views.eliminar_tarea, name='eliminar_tarea'),
    path('exportar/', views.exportar_csv, name='exportar_csv'),
    path('importar/', views.importar_csv, name='importar_csv'),
    path('detalle/<int:id>/', views.detalle_tarea, name='detalle_tarea'),
    path('cambiar-estado/<int:id>/<str:estado>/',
         views.cambiar_estado_simple,
         name='cambiar_estado_simple'),
    path('logout/', auth_views.LogoutView.as_view(), name='logout'),
    path('eliminar-seleccionadas/', views.eliminar_tareas_seleccionadas, name='eliminar_tareas_seleccionadas'),
    path('tareas/<int:id>/prioridad/<int:prioridad>/', views.cambiar_prioridad, name='cambiar_prioridad'),
]

Route Details

The sections below document each route individually. Routes that require authentication redirect unauthenticated users to / (the login page) as configured by LOGIN_URL = 'login' and LOGIN_REDIRECT_URL = '/tareas/' in settings.py.

GET / — Login Page

name
string
login
view
string
django.contrib.auth.views.LoginView — renders tareas/login.html
authentication
string
Public — no login required
Displays the login form. On successful authentication, Django redirects to LOGIN_REDIRECT_URL (/tareas/). After logout, LOGOUT_REDIRECT_URL also points here (/).

GET /tareas/ — Task List

name
string
lista_tareas
view
string
tareas.views.lista_tareas
authentication
string
Required — @login_required
Renders the main task list. Supports both a Kanban view (tasks grouped by state in columns) and a list view (paginated flat table), toggled via the vista query parameter. Tasks are ordered by estado then id. Pagination is set to 10 tasks per page. Query Parameters
vista
string
default:"kanban"
Switches the display mode. Accepted values: kanban, lista.
estado
string
Filters the list to tasks matching the given state. Accepted values: Borrador, Pendiente, En proceso, Completada.
buscar
string
Case-insensitive substring filter applied to titulo (icontains lookup).
page
integer
default:"1"
Page number for the paginated list view.

GET /crear/ — New Task Form

name
string
crear_tarea
view
string
tareas.views.crear_tarea
authentication
string
Public — no @login_required decorator is applied to this view
Renders an empty TareaForm in tareas/detalle.html with modo_formulario=True and tarea=None.

POST /crear/ — Submit New Task

name
string
crear_tarea
view
string
tareas.views.crear_tarea
authentication
string
Public
Validates the submitted TareaForm. On success, saves the new Tarea and redirects to detalle_tarea for the newly created task ID. On failure, re-renders the form with validation errors.

GET /editar/<id>/ — Edit Task Form

name
string
editar_tarea
view
string
tareas.views.editar_tarea
authentication
string
Required — @login_required
Fetches the Tarea with the given id (404 if not found) and renders a pre-populated TareaForm in tareas/detalle.html with modo_formulario=True. Path Parameters
id
integer
required
Primary key of the task to edit.

POST /editar/<id>/ — Submit Edit Form

name
string
editar_tarea
view
string
tareas.views.editar_tarea
authentication
string
Required — @login_required
Validates the submitted form bound to the existing Tarea instance. On success, saves and redirects to detalle_tarea, setting a success message via django.contrib.messages. On failure, re-renders with errors. Path Parameters
id
integer
required
Primary key of the task to update.

GET /eliminar/<id>/ — Delete Confirmation Page

name
string
eliminar_tarea
view
string
tareas.views.eliminar_tarea
authentication
string
Required — @login_required
Renders tareas/confirmar_eliminar.html with the Tarea object so the template can display task details before the user confirms deletion. Path Parameters
id
integer
required
Primary key of the task to delete.

POST /eliminar/<id>/ — Confirm Delete

name
string
eliminar_tarea
view
string
tareas.views.eliminar_tarea
authentication
string
Required — @login_required
Deletes the specified Tarea and redirects to /tareas/?vista=lista with a success message. Path Parameters
id
integer
required
Primary key of the task to delete.

GET /detalle/<id>/ — Task Detail View

name
string
detalle_tarea
view
string
tareas.views.detalle_tarea
authentication
string
Required — @login_required
Renders the read-only detail view for a single task in tareas/detalle.html with modo_formulario=False. Also computes the task’s position in the full ordered list and provides anterior/siguiente navigation references. Path Parameters
id
integer
required
Primary key of the task to display.
Query Parameters
vista
string
default:"kanban"
Passed through to the template so the “back” navigation link can return to the correct list view mode.
page
string
default:"1"
Passed through to preserve the current list page when navigating back.
seleccion
string
Defaults to the task’s own id as a string. Used by the template to highlight the active row in list view.

GET /exportar/ — Export Single Task as CSV

name
string
exportar_csv
view
string
tareas.views.exportar_csv
authentication
string
Required — @login_required
Returns a CSV file attachment (tareas.csv). When tarea_id is supplied, only that task is exported. When tarea_id is absent and no POST body is present, all tasks are exported ordered by estado. Query Parameters
tarea_id
integer
If provided, restricts the export to the single task with this primary key.
CSV Columns (in order): id, titulo, descripcion, estado, prioridad, fecha_limite, fecha_creada

POST /exportar/ — Export Selected Tasks as CSV

name
string
exportar_csv
view
string
tareas.views.exportar_csv
authentication
string
Required — @login_required
Accepts a list of task IDs in the POST body. Exports only those tasks, ordered by estado. If the list is empty and no tarea_id query param is set, all tasks are exported. POST Body Parameters
tareas_seleccionadas
string[]
A multi-value list of task primary keys to include in the export.

GET /importar/ — Import CSV Form

name
string
importar_csv
view
string
tareas.views.importar_csv
authentication
string
Required — @login_required
Renders tareas/importar_csv.html with a file upload form.

POST /importar/ — Upload CSV File

name
string
importar_csv
view
string
tareas.views.importar_csv
authentication
string
Required — @login_required
Processes the uploaded CSV file. Rows whose id already exists in the database are skipped (not overwritten). Rows with processing errors are silently counted as errores. Encoding is attempted first as utf-8-sig, then falls back to latin-1. On completion, redirects to lista_tareas with an appropriate success or warning message. POST Body Parameters
archivo_csv
file
required
A CSV file whose columns match the export format: id, titulo, descripcion, estado, prioridad, fecha_limite, fecha_creada.
The import skips any row whose id already exists in the tareas_tarea table. To update existing tasks, edit them individually via /editar/<id>/.

GET /cambiar-estado/<id>/<estado>/ — Quick State Change

name
string
cambiar_estado_simple
view
string
tareas.views.cambiar_estado_simple
authentication
string
Required — @login_required
Sets tarea.estado to the provided estado value and saves. Redirects to detalle_tarea for the same task with a success message. Path Parameters
id
integer
required
Primary key of the task to update.
estado
string
required
New state value. Must be one of: Borrador, Pendiente, En proceso, Completada.
No server-side validation is performed on the estado path parameter beyond what Django’s <str:estado> converter provides (any non-empty string). Passing a value outside the ESTADOS choices will persist an invalid state in the database. Always use one of the four defined values.

POST /logout/ — Log Out

name
string
logout
view
string
django.contrib.auth.views.LogoutView
authentication
string
Session-based — clears the current user’s session
Logs out the authenticated user and redirects to LOGOUT_REDIRECT_URL (/).

POST /eliminar-seleccionadas/ — Bulk Delete

name
string
eliminar_tareas_seleccionadas
view
string
tareas.views.eliminar_tareas_seleccionadas
authentication
string
No @login_required decorator — relies on session context from the list page
Deletes all tasks whose IDs are present in the tareas_seleccionadas POST list. Redirects to /tareas/?vista=lista after deletion. Sets a singular or plural success message depending on how many tasks were deleted. POST Body Parameters
tareas_seleccionadas
string[]
required
One or more task primary keys to delete.

GET /tareas/<id>/prioridad/<prioridad>/ — Quick Priority Change

name
string
cambiar_prioridad
view
string
tareas.views.cambiar_prioridad
authentication
string
Required — @login_required
Sets tarea.prioridad to the provided integer value and saves. Redirects to detalle_tarea for the same task. Path Parameters
id
integer
required
Primary key of the task to update.
prioridad
integer
required
New priority value. Must be one of: 1 (Baja), 2 (Media), 3 (Alta).

GET /admin/ — Django Admin

view
string
django.contrib.admin — Django’s built-in admin site
authentication
string
Django admin’s own authentication — requires a superuser or staff account
Mounts the full Django administration interface. See the Admin Panel reference for configuration details.

Route Summary Table

MethodPathURL NameAuth Required
GET/loginNo
GET/tareas/lista_tareasYes
GET/crear/crear_tareaNo
POST/crear/crear_tareaNo
GET/editar/<id>/editar_tareaYes
POST/editar/<id>/editar_tareaYes
GET/eliminar/<id>/eliminar_tareaYes
POST/eliminar/<id>/eliminar_tareaYes
GET/detalle/<id>/detalle_tareaYes
GET/exportar/exportar_csvYes
POST/exportar/exportar_csvYes
GET/importar/importar_csvYes
POST/importar/importar_csvYes
GET/cambiar-estado/<id>/<estado>/cambiar_estado_simpleYes
POST/logout/logoutSession
POST/eliminar-seleccionadas/eliminar_tareas_seleccionadasNo
GET/tareas/<id>/prioridad/<prioridad>/cambiar_prioridadYes
GET/POST/admin/Admin auth

Build docs developers (and LLMs) love