POST request with several keys

Report a typo

The service is used for TODO lists. Implement the post method for adding new tasks.

The next task is passed in the request body with the key todo. Add this task if it's not already present in the all_todos list.

Another key passed in the body is important. The value can be True or False. If the task is important, add it at the beginning of the list; if it's not, put it at the end.

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 post(self, request, *args, **kwargs):
...
___

Create a free account to access the full topic