﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
27289	Docs: Badly wrong explanation of View.as_view() and its use in urlconf	Graham Wideman	nobody	"In the Introduction to class-based view (for example, https://docs.djangoproject.com/en/1.10/topics/class-based-views/intro/) the explanation for the as_view() method is wrong in a way which undermines clear understanding of a crucial piece of the CBV apparatus.

 Existing narrative: ""Because Django’s URL resolver expects to send the request and associated arguments to a callable function, not a class, class-based views have an as_view() class method which serves as the callable entry point to your class. The as_view entry point creates an instance of your class and calls its dispatch() method.""

The as_view() class method is NOT the entry point and does NOT instantiate your class. If as_view() were the entry point, then its use in urlpatterns would omit the function brackets, and the subsequent Note about setting class attributes would make no sense.

The narrative should be changed to something more like:

 ""Django’s URL resolver expects to send the request and associated arguments to a callable function (as it does for function-based views), and so will not accept a class as the view argument in the url() function.  Consequently, the View base class provides the as_view() class method which *returns a class method* that serves as the callable entry point to your class. Note that the as_view() function itself is *not* the entry point per se.   The function that as_view() returns (called later by the URL resolver when a request arrives for a URL matching the associated pattern) is responsible for instantiating your actual view class, and calling its dispatch() method."""	Bug	closed	Documentation	1.10	Normal	fixed	CBV as_view		Accepted	1	0	0	0	1	0
