Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #14829 - Added references to CBVs in the URLConf docs; thanks A…

…ndrew Willey for the suggestion.
  • Loading branch information...
commit acd74ffa358a64861fae8fd7bf020fc3a50341b2 1 parent 1360bd4
Tim Graham authored September 19, 2012

Showing 1 changed file with 11 additions and 1 deletion. Show diff stats Hide diff stats

  1. 12  docs/topics/http/urls.txt
12  docs/topics/http/urls.txt
@@ -55,7 +55,8 @@ algorithm the system follows to determine which Python code to execute:
55 55
    one that matches the requested URL.
56 56
 
57 57
 4. Once one of the regexes matches, Django imports and calls the given
58  
-   view, which is a simple Python function. The view gets passed an
  58
+   view, which is a simple Python function (or a :doc:`class based view
  59
+   </topics/class-based-views/index>`). The view gets passed an
59 60
    :class:`~django.http.HttpRequest` as its first argument and any values
60 61
    captured in the regex as remaining arguments.
61 62
 
@@ -673,6 +674,15 @@ The style you use is up to you.
673 674
 Note that if you use this technique -- passing objects rather than strings --
674 675
 the view prefix (as explained in "The view prefix" above) will have no effect.
675 676
 
  677
+Note that :doc:`class based views</topics/class-based-views/index>` must be
  678
+imported::
  679
+
  680
+    from mysite.views import ClassBasedView
  681
+
  682
+    urlpatterns = patterns('',
  683
+        (r'^myview/$', ClassBasedView.as_view()),
  684
+    )
  685
+
676 686
 .. _naming-url-patterns:
677 687
 
678 688
 Naming URL patterns

0 notes on commit acd74ff

Please sign in to comment.
Something went wrong with that request. Please try again.