A clean, secure, and dynamic ToDo Management App built with Django, Django REST Framework, HTMX, and TailwindCSS (DaisyUI).
It supports both a fully-documented RESTful API and an interactive web UI without heavy JavaScript.
- Register / Login via JWT
- Create / Read / Update / Delete your tasks
- Tasks are user-specific (private per user)
- Filtering, searching, ordering support
- Swagger / ReDoc auto documentation
- Dynamic task list
- Modal for create / update tasks
- Built using HTMX + Django Partials
- Fully responsive with DaisyUI design
| Layer | Tools Used |
|---|---|
| Backend | Django 5.2.3, Django REST Framework |
| Auth | Simple JWT (Access/Refresh tokens) |
| API Docs | drf-spectacular (OpenAPI/Swagger/ReDoc) |
| UI Framework | Django Templates + HTMX |
| CSS Styling | TailwindCSS + DaisyUI |
| Filtering | django-filter |
# 1. Clone repo
git clone https://github.com/alanhasn/Task-manager-using-Django-HTMX-and-DRF
cd Task-manager-using-Django-HTMX-and-DRF
# 2. Create virtual env
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Apply migrations
python manage.py migrate
# 5. Run server
python manage.py runserverPOST /api/register/
{
"username": "mohammed doe",
"email": "doela@example.com",
"password": "StrongPassword123"
}POST /api/login/
{
"username": "mohammed doe",
"password": "StrongPassword123"
}POST /api/token/refresh/
{
"refresh": "<your_refresh_token>"
}- Swagger UI β http://127.0.0.1:8000/api/schema/swagger-ui/
- Redoc β http://127.0.0.1:8000/api/schema/redoc/
- Schema YML β http://127.0.0.1:8000/api/schema/
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | /api/todos/ | List current userβs todos | β |
| POST | /api/todos/ | Create a new todo | β |
| GET | /api/todos/{id}/ | Retrieve a specific todo | β |
| PUT | /api/todos/{id}/ | Update a todo | β |
| DELETE | /api/todos/{id}/ | Delete a todo | β |
| GET | /api/users/ | Get authenticated user + related todos | β |
| Feature | Example |
|---|---|
| Filter | /api/todos/?completed=true |
| Date Range | /api/todos/?created_at__gte=2024-01-01 |
| Search | /api/todos/?search=meeting |
| Order | /api/todos/?ordering=-updated_at |
| Page | Description |
|---|---|
| π Login / Register | Forms for Session authentication , login and registration |
| π Dashboard | List of tasks for logged-in user |
| π Create Task | Form to add new task using hx-post |
| π Update Task | Inline or modal form using hx-post |
| β Delete Task | Deletion via hx-delete with confirmation |
hx-getβ Load dynamic content (e.g. task table)hx-postβ Create taskhx-deleteβ Delete taskhx-target,hx-swapβ Update DOM elementshx-triggerβ triggers likeload,submit,change
- Separation of API & UI logic
- Modularized app using
todo/api/ - DRY templates using
partials/ - Auth-protected views and endpoints
- Password validation with strong rules
- HTMX + Django used progressively (no JS frameworks)
- π€ Developed by: @alanhasn
- π
first Issue Closed:
June 29, 2025 - π Project Repository: https://github.com/alanhasn/Task-manager-using-Django-HTMX-and-DRF
This project is licensed under the MIT License.
See LICENSE file for more details.








