Skip to content

Commit

Permalink
[1.5.x] Fixed #19605 - Removed unused url imports from doc examples.
Browse files Browse the repository at this point in the history
Thanks sergzach for the suggestion.

Backport of 43f89e0 from master
  • Loading branch information
timgraham committed Jan 15, 2013
1 parent 5a53f10 commit 360676d
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/intro/overview.txt
Expand Up @@ -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'),
Expand Down
6 changes: 3 additions & 3 deletions docs/ref/contrib/admin/index.txt
Expand Up @@ -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()
Expand All @@ -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('',
Expand All @@ -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('',
Expand Down
2 changes: 1 addition & 1 deletion docs/ref/contrib/comments/example.txt
Expand Up @@ -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('',
Expand Down
2 changes: 1 addition & 1 deletion docs/ref/contrib/sitemaps.txt
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions docs/ref/contrib/syndication.txt
Expand Up @@ -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('',
Expand Down Expand Up @@ -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('',
Expand Down
2 changes: 1 addition & 1 deletion docs/ref/models/instances.txt
Expand Up @@ -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'),

Expand Down
2 changes: 1 addition & 1 deletion docs/topics/class-based-views/generic-display.txt
Expand Up @@ -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('',
Expand Down
4 changes: 2 additions & 2 deletions docs/topics/class-based-views/index.txt
Expand Up @@ -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('',
Expand Down Expand Up @@ -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('',
Expand Down
10 changes: 5 additions & 5 deletions docs/topics/http/urls.txt
Expand Up @@ -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'),
Expand Down Expand Up @@ -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'),
Expand All @@ -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'),
Expand All @@ -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'),
Expand All @@ -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'),
Expand Down

0 comments on commit 360676d

Please sign in to comment.