Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #19605 - Removed unused url imports from doc examples.

Thanks sergzach for the suggestion.
  • Loading branch information...
commit 43f89e0ad6fa111f3d53dfa71786353e0265bf39 1 parent 2f8ab2f
Tim Graham authored
2  docs/intro/overview.txt
@@ -176,7 +176,7 @@ decouple URLs from Python code.
176 176
 Here's what a URLconf might look like for the ``Reporter``/``Article``
177 177
 example above::
178 178
 
179  
-    from django.conf.urls import patterns, url, include
  179
+    from django.conf.urls import patterns
180 180
 
181 181
     urlpatterns = patterns('',
182 182
         (r'^articles/(\d{4})/$', 'news.views.year_archive'),
6  docs/ref/contrib/admin/index.txt
@@ -1928,7 +1928,7 @@ In this example, we register the default ``AdminSite`` instance
1928 1928
 ``django.contrib.admin.site`` at the URL ``/admin/`` ::
1929 1929
 
1930 1930
     # urls.py
1931  
-    from django.conf.urls import patterns, url, include
  1931
+    from django.conf.urls import patterns, include
1932 1932
     from django.contrib import admin
1933 1933
 
1934 1934
     admin.autodiscover()
@@ -1944,7 +1944,7 @@ In this example, we register the ``AdminSite`` instance
1944 1944
 ``myproject.admin.admin_site`` at the URL ``/myadmin/`` ::
1945 1945
 
1946 1946
     # urls.py
1947  
-    from django.conf.urls import patterns, url, include
  1947
+    from django.conf.urls import patterns, include
1948 1948
     from myproject.admin import admin_site
1949 1949
 
1950 1950
     urlpatterns = patterns('',
@@ -1968,7 +1968,7 @@ separate versions of the admin site -- using the ``AdminSite`` instances
1968 1968
 respectively::
1969 1969
 
1970 1970
     # urls.py
1971  
-    from django.conf.urls import patterns, url, include
  1971
+    from django.conf.urls import patterns, include
1972 1972
     from myproject.admin import basic_site, advanced_site
1973 1973
 
1974 1974
     urlpatterns = patterns('',
2  docs/ref/contrib/comments/example.txt
@@ -141,7 +141,7 @@ enable it in your project's ``urls.py``:
141 141
 
142 142
 .. code-block:: python
143 143
 
144  
-  from django.conf.urls import patterns, url, include
  144
+  from django.conf.urls import patterns
145 145
   from django.contrib.comments.feeds import LatestCommentFeed
146 146
 
147 147
   urlpatterns = patterns('',
2  docs/ref/contrib/sitemaps.txt
@@ -256,7 +256,7 @@ Example
256 256
 
257 257
 Here's an example of a :doc:`URLconf </topics/http/urls>` using both::
258 258
 
259  
-    from django.conf.urls import patterns, url, include
  259
+    from django.conf.urls import patterns
260 260
     from django.contrib.sitemaps import FlatPageSitemap, GenericSitemap
261 261
     from blog.models import Entry
262 262
 
4  docs/ref/contrib/syndication.txt
@@ -77,7 +77,7 @@ latest five news items::
77 77
 To connect a URL to this feed, put an instance of the Feed object in
78 78
 your :doc:`URLconf </topics/http/urls>`. For example::
79 79
 
80  
-    from django.conf.urls import patterns, url, include
  80
+    from django.conf.urls import patterns
81 81
     from myproject.feeds import LatestEntriesFeed
82 82
 
83 83
     urlpatterns = patterns('',
@@ -321,7 +321,7 @@ Here's a full example::
321 321
 
322 322
 And the accompanying URLconf::
323 323
 
324  
-    from django.conf.urls import patterns, url, include
  324
+    from django.conf.urls import patterns
325 325
     from myproject.feeds import RssSiteNewsFeed, AtomSiteNewsFeed
326 326
 
327 327
     urlpatterns = patterns('',
2  docs/ref/models/instances.txt
@@ -601,7 +601,7 @@ pattern, it's possible to give a name to a pattern, and then reference the name
601 601
 rather than the view function. A named URL pattern is defined by replacing the
602 602
 pattern tuple by a call to the ``url`` function)::
603 603
 
604  
-    from django.conf.urls import patterns, url, include
  604
+    from django.conf.urls import url
605 605
 
606 606
     url(r'^people/(\d+)/$', 'blog_views.generic_detail', name='people_view'),
607 607
 
2  docs/topics/class-based-views/generic-display.txt
@@ -110,7 +110,7 @@ Now we need to define a view::
110 110
 Finally hook that view into your urls::
111 111
 
112 112
     # urls.py
113  
-    from django.conf.urls import patterns, url, include
  113
+    from django.conf.urls import patterns, url
114 114
     from books.views import PublisherList
115 115
 
116 116
     urlpatterns = patterns('',
4  docs/topics/class-based-views/index.txt
@@ -37,7 +37,7 @@ URLconf. If you're only changing a few simple attributes on a class-based view,
37 37
 you can simply pass them into the
38 38
 :meth:`~django.views.generic.base.View.as_view` method call itself::
39 39
 
40  
-    from django.conf.urls import patterns, url, include
  40
+    from django.conf.urls import patterns
41 41
     from django.views.generic import TemplateView
42 42
 
43 43
     urlpatterns = patterns('',
@@ -73,7 +73,7 @@ point the URL to the :meth:`~django.views.generic.base.View.as_view` class
73 73
 method instead, which provides a function-like entry to class-based views::
74 74
 
75 75
     # urls.py
76  
-    from django.conf.urls import patterns, url, include
  76
+    from django.conf.urls import patterns
77 77
     from some_app.views import AboutView
78 78
 
79 79
     urlpatterns = patterns('',
10  docs/topics/http/urls.txt
@@ -66,7 +66,7 @@ Example
66 66
 
67 67
 Here's a sample URLconf::
68 68
 
69  
-    from django.conf.urls import patterns, url, include
  69
+    from django.conf.urls import patterns
70 70
 
71 71
     urlpatterns = patterns('',
72 72
         (r'^articles/2003/$', 'news.views.special_case_2003'),
@@ -255,7 +255,7 @@ code duplication.
255 255
 
256 256
 Here's the example URLconf from the :doc:`Django overview </intro/overview>`::
257 257
 
258  
-    from django.conf.urls import patterns, url, include
  258
+    from django.conf.urls import patterns
259 259
 
260 260
     urlpatterns = patterns('',
261 261
         (r'^articles/(\d{4})/$', 'news.views.year_archive'),
@@ -270,7 +270,7 @@ each view function.
270 270
 
271 271
 With this in mind, the above example can be written more concisely as::
272 272
 
273  
-    from django.conf.urls import patterns, url, include
  273
+    from django.conf.urls import patterns
274 274
 
275 275
     urlpatterns = patterns('news.views',
276 276
         (r'^articles/(\d{4})/$', 'year_archive'),
@@ -291,7 +291,7 @@ Just add multiple ``patterns()`` objects together, like this:
291 291
 
292 292
 Old::
293 293
 
294  
-    from django.conf.urls import patterns, url, include
  294
+    from django.conf.urls import patterns
295 295
 
296 296
     urlpatterns = patterns('',
297 297
         (r'^$', 'myapp.views.app_index'),
@@ -301,7 +301,7 @@ Old::
301 301
 
302 302
 New::
303 303
 
304  
-    from django.conf.urls import patterns, url, include
  304
+    from django.conf.urls import patterns
305 305
 
306 306
     urlpatterns = patterns('myapp.views',
307 307
         (r'^$', 'app_index'),

0 notes on commit 43f89e0

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