Introduction to Django’s Class based views — Understanding how a class based view works

from django.http import HttpResponse
from django.views.generic import View
class TestView(View):

def get(self, request, *args, **kwargs):
return HttpResponse('Hello, World!')
from django.conf.urls import url
from testapp.views import TestView
urlpatterns = [
url(r'^hello-world/$', TestView.as_view(), name='hello_world'),
]

The article was originally published at MicroPyramid blog.

--

--

--

Python, Django, Android and IOS, reactjs, react-native, AWS, Salesforce consulting & development company

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

https://t.me/TykeInuAirdropbot?start=r06988653414

Learning Programming at the Absolutely Slowest Pace

Calculating approximate time and distance between two locations using Geocoding and Directions API.

Social Distancing with OpenCV and CUDA in C++

Divide & Conquer Pattern

Using Streams for Validation in Flutter.

Running dbt using Gitlab CI/CD

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
MicroPyramid

MicroPyramid

Python, Django, Android and IOS, reactjs, react-native, AWS, Salesforce consulting & development company

More from Medium

Django Model implementation (Part II)

Zipping Files In-Memory Using Django

Retrieve Twilio Call Logs Using Django

Building a simple Poll System in Django [Part - I]