Tsallaka zuwa abun ciki
Justice Tech School

Class Based Views

View classes handle methods separately.

Example
from django.views import View

class Hello(View):
    def get(self, request):
        return HttpResponse("hi")

# path("hello/", Hello.as_view())

Exercise

Register a class view.

Hello.()

Quiz Test

What turns a class into a view callable?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.