Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save eclecticmiraclecat/8a76e3153bd967c096e50d54368519e5 to your computer and use it in GitHub Desktop.
Save eclecticmiraclecat/8a76e3153bd967c096e50d54368519e5 to your computer and use it in GitHub Desktop.
# urls.py
from cbvApp.views import GreetingView

urlpatterns = [
    path('', GreetingView.as_view(msg='hi'))
]
# views.py
from django.views.generic import View
from django.http import HttpResponse

class GreetingView(View):
  msg = None
  def get(self, request):
    return HttpResponse(self.msg)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment