Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[1.5.x] Fixed #19605 - Removed unused url imports from doc examples.

Thanks sergzach for the suggestion.

Backport of 43f89e0 from master
  • Loading branch information...
commit 360676d9d86ed36a2ffcf1318904b2b56cfae641 1 parent 5a53f10
Tim Graham timgraham authored
2  docs/intro/overview.txt
View
@@ -176,7 +176,7 @@ decouple URLs from Python code.
Here's what a URLconf might look like for the ``Reporter``/``Article``
example above::
- from django.conf.urls import patterns, url, include
+ from django.conf.urls import patterns
urlpatterns = patterns('',
(r'^articles/(\d{4})/$', 'news.views.year_archive'),
6 docs/ref/contrib/admin/index.txt
View
@@ -1963,7 +1963,7 @@ In this example, we register the default ``AdminSite`` instance
``django.contrib.admin.site`` at the URL ``/admin/`` ::
# urls.py
- from django.conf.urls import patterns, url, include
+ from django.conf.urls import patterns, include
from django.contrib import admin
admin.autodiscover()
@@ -1979,7 +1979,7 @@ In this example, we register the ``AdminSite`` instance
``myproject.admin.admin_site`` at the URL ``/myadmin/`` ::
# urls.py
- from django.conf.urls import patterns, url, include
+ from django.conf.urls import patterns, include
from myproject.admin import admin_site
urlpatterns = patterns('',
@@ -2003,7 +2003,7 @@ separate versions of the admin site -- using the ``AdminSite`` instances
respectively::
# urls.py
- from django.conf.urls import patterns, url, include
+ from django.conf.urls import patterns, include
from myproject.admin import basic_site, advanced_site
urlpatterns = patterns('',
2  docs/ref/contrib/comments/example.txt
View
@@ -141,7 +141,7 @@ enable it in your project's ``urls.py``:
.. code-block:: python
- from django.conf.urls import patterns, url, include
+ from django.conf.urls import patterns
from django.contrib.comments.feeds import LatestCommentFeed
urlpatterns = patterns('',
2  docs/ref/contrib/sitemaps.txt
View
@@ -258,7 +258,7 @@ Example
Here's an example of a :doc:`URLconf </topics/http/urls>` using both::
- from django.conf.urls import patterns, url, include
+ from django.conf.urls import patterns
from django.contrib.sitemaps import FlatPageSitemap, GenericSitemap
from blog.models import Entry
4 docs/ref/contrib/syndication.txt
View
@@ -77,7 +77,7 @@ latest five news items::
To connect a URL to this feed, put an instance of the Feed object in
your :doc:`URLconf </topics/http/urls>`. For example::
- from django.conf.urls import patterns, url, include
+ from django.conf.urls import patterns
from myproject.feeds import LatestEntriesFeed
urlpatterns = patterns('',
@@ -321,7 +321,7 @@ Here's a full example::
And the accompanying URLconf::
- from django.conf.urls import patterns, url, include
+ from django.conf.urls import patterns
from myproject.feeds import RssSiteNewsFeed, AtomSiteNewsFeed
urlpatterns = patterns('',
2  docs/ref/models/instances.txt
View
@@ -601,7 +601,7 @@ pattern, it's possible to give a name to a pattern, and then reference the name
rather than the view function. A named URL pattern is defined by replacing the
pattern tuple by a call to the ``url`` function)::
- from django.conf.urls import patterns, url, include
+ from django.conf.urls import url
url(r'^people/(\d+)/$', 'blog_views.generic_detail', name='people_view'),
2  docs/topics/class-based-views/generic-display.txt
View
@@ -110,7 +110,7 @@ Now we need to define a view::
Finally hook that view into your urls::
# urls.py
- from django.conf.urls import patterns, url, include
+ from django.conf.urls import patterns, url
from books.views import PublisherList
urlpatterns = patterns('',
4 docs/topics/class-based-views/index.txt
View
@@ -37,7 +37,7 @@ URLconf. If you're only changing a few simple attributes on a class-based view,
you can simply pass them into the
:meth:`~django.views.generic.base.View.as_view` method call itself::
- from django.conf.urls import patterns, url, include
+ from django.conf.urls import patterns
from django.views.generic import TemplateView
urlpatterns = patterns('',
@@ -73,7 +73,7 @@ point the URL to the :meth:`~django.views.generic.base.View.as_view` class
method instead, which provides a function-like entry to class-based views::
# urls.py
- from django.conf.urls import patterns, url, include
+ from django.conf.urls import patterns
from some_app.views import AboutView
urlpatterns = patterns('',
10 docs/topics/http/urls.txt
View
@@ -67,7 +67,7 @@ Example
Here's a sample URLconf::
- from django.conf.urls import patterns, url, include
+ from django.conf.urls import patterns
urlpatterns = patterns('',
(r'^articles/2003/$', 'news.views.special_case_2003'),
@@ -259,7 +259,7 @@ code duplication.
Here's the example URLconf from the :doc:`Django overview </intro/overview>`::
- from django.conf.urls import patterns, url, include
+ from django.conf.urls import patterns
urlpatterns = patterns('',
(r'^articles/(\d{4})/$', 'news.views.year_archive'),
@@ -274,7 +274,7 @@ each view function.
With this in mind, the above example can be written more concisely as::
- from django.conf.urls import patterns, url, include
+ from django.conf.urls import patterns
urlpatterns = patterns('news.views',
(r'^articles/(\d{4})/$', 'year_archive'),
@@ -295,7 +295,7 @@ Just add multiple ``patterns()`` objects together, like this:
Old::
- from django.conf.urls import patterns, url, include
+ from django.conf.urls import patterns
urlpatterns = patterns('',
(r'^$', 'myapp.views.app_index'),
@@ -305,7 +305,7 @@ Old::
New::
- from django.conf.urls import patterns, url, include
+ from django.conf.urls import patterns
urlpatterns = patterns('myapp.views',
(r'^$', 'app_index'),
Please sign in to comment.
Something went wrong with that request. Please try again.