POST Request

Report a typo

The service we're creating 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.

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