Skip to content

Instantly share code, notes, and snippets.

@patrys
Created December 20, 2016 19:01
Show Gist options
  • Save patrys/d9c4aaa5d9b90ce0db2b2e07ebff0f4a to your computer and use it in GitHub Desktop.
Save patrys/d9c4aaa5d9b90ce0db2b2e07ebff0f4a to your computer and use it in GitHub Desktop.
from django.views.generic import View
from django.template.response import TemplateResponse
def get(request):
return TemplateResponse(request, 'index.html')
my_class_based_view = View.as_view(get=get)
# TypeError: You tried to pass in the get method name as a keyword argument to View(). Don't do that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment