PUT request with several keys

Report a typo

The service is used for TODO lists. Implement the put method for adding new tasks and changing the old ones.

The next task is passed in the request body with the key todo. Another key passed in the body is new. The value can be True or False. If the task is new, add it at the end of the list; if it's not, change the task with the id index.

The response should be a redirection to the / page.

Write a program in Python 3
from django.shortcuts import redirect
from django.views import View


class TodoView(View):
all_todos = []

def put(self, request, id, *args, **kwargs):
...
___

Create a free account to access the full topic