TodoMVC backend built as a Django app.
Install todomvc
via pip
:
$ pip install django-todomvc
Add todomvc
to INSTALLED_APPS
:
INSTALLED_APPS = (
# Other apps
'todomvc'
)
At least, include todomvc
URLs:
# urls.py
urlpatterns = patterns(
'',
# Other patterns
(r'^/todo', include('todomvc.urls'))
)
Lists tasks already created.
Status: 200 OK
[
{
"id": 1,
"title": "Buy groceries",
"completed": false
},
{
"id": 2,
"title": "Do laundry",
"completed": true
}
]
Creates a new task.
{
"title": "Buy groceries"
}
Status: 201 Created
{
"id": 1,
"title": "Buy groceries",
"completed": false
}
Retrieves a task.
Status: 200 OK
{
"id": 1,
"title": "Buy groceries",
"completed": false
}
Allows a full update of a task. Both title
and completed
arguments must be provided.
{
"title": "Buy groceries",
"completed": true
}
Status: 200 OK
{
"id": 1,
"title": "Buy groceries",
"completed": true
}
Allows a partial update of a task.
{
"completed": true
}
Status: 200 OK
{
"id": 1,
"title": "Buy groceries",
"completed": true
}
Removes a task.
Status: 204 No content
See the LICENSE file for details.