Ticket #14675: 14675-remove-import-star-from-urlconfs-2.patch

File 14675-remove-import-star-from-urlconfs-2.patch, 40.3 KB (added by Craig de Stigter, 14 years ago)

all-in-one patch, with tweaked docs and made from django.conf.urls import patterns work (& the standard way to import url functions)

  • django/conf/project_template/urls.py

    diff --git a/django/conf/project_template/urls.py b/django/conf/project_template/urls.py
    index 3d0ff63..95fbb83 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, url, include
    22
    33# Uncomment the next two lines to enable the admin:
    44# from django.contrib import admin
  • django/conf/urls/__init__.py

    diff --git a/django/conf/urls/__init__.py b/django/conf/urls/__init__.py
    index e69de29..6084bf8 100644
    a b  
     1from django.conf.urls.defaults import *
  • django/conf/urls/i18n.py

    diff --git a/django/conf/urls/i18n.py b/django/conf/urls/i18n.py
    index 00e2d60..34a93e2 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns
    22
    33urlpatterns = patterns('',
    44    (r'^setlang/$', 'django.views.i18n.set_language'),
  • django/conf/urls/shortcut.py

    diff --git a/django/conf/urls/shortcut.py b/django/conf/urls/shortcut.py
    index 135f3be..6eb2e55 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns
    22
    33urlpatterns = patterns('django.views',
    44    (r'^(?P<content_type_id>\d+)/(?P<object_id>.*)/$', 'defaults.shortcut'),
  • django/contrib/admin/options.py

    diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
    index ffc6e79..ec7d2a6 100644
    a b class ModelAdmin(BaseModelAdmin):  
    238238        super(ModelAdmin, self).__init__()
    239239
    240240    def get_urls(self):
    241         from django.conf.urls.defaults import patterns, url
     241        from django.conf.urls import patterns, url
    242242
    243243        def wrap(view):
    244244            def wrapper(*args, **kwargs):
  • django/contrib/admin/sites.py

    diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py
    index b995c0f..bda2f2f 100644
    a b class AdminSite(object):  
    173173            class MyAdminSite(AdminSite):
    174174
    175175                def get_urls(self):
    176                     from django.conf.urls.defaults import patterns, url
     176                    from django.conf.urls import patterns, url
    177177
    178178                    urls = super(MyAdminSite, self).get_urls()
    179179                    urls += patterns('',
    class AdminSite(object):  
    198198        return update_wrapper(inner, view)
    199199
    200200    def get_urls(self):
    201         from django.conf.urls.defaults import patterns, url, include
     201        from django.conf.urls import patterns, url, include
    202202
    203203        if settings.DEBUG:
    204204            self.check_dependencies()
  • django/contrib/admindocs/urls.py

    diff --git a/django/contrib/admindocs/urls.py b/django/contrib/admindocs/urls.py
    index 57edb56..4f50049 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, url
    22from django.contrib.admindocs import views
    33
    44urlpatterns = patterns('',
  • django/contrib/auth/admin.py

    diff --git a/django/contrib/auth/admin.py b/django/contrib/auth/admin.py
    index 61bae28..4b7abde 100644
    a b class UserAdmin(admin.ModelAdmin):  
    7474        return super(UserAdmin, self).get_form(request, obj, **defaults)
    7575
    7676    def get_urls(self):
    77         from django.conf.urls.defaults import patterns
     77        from django.conf.urls import patterns
    7878        return patterns('',
    7979            (r'^(\d+)/password/$', self.admin_site.admin_view(self.user_change_password))
    8080        ) + super(UserAdmin, self).get_urls()
  • django/contrib/auth/tests/urls.py

    diff --git a/django/contrib/auth/tests/urls.py b/django/contrib/auth/tests/urls.py
    index 51b7d92..c26d68e 100644
    a b  
    1 from django.conf.urls.defaults import patterns
     1from django.conf.urls import patterns
    22from django.contrib.auth.urls import urlpatterns
    33from django.contrib.auth.views import password_reset
    44from django.contrib.auth.decorators import login_required
  • django/contrib/auth/urls.py

    diff --git a/django/contrib/auth/urls.py b/django/contrib/auth/urls.py
    index 4f8a102..3daaa66 100644
    a b  
    22# provided as a convenience to those who want to deploy these URLs elsewhere.
    33# This file is also used to provide a reliable view deployment for test purposes.
    44
    5 from django.conf.urls.defaults import *
     5from django.conf.urls import patterns
    66
    77urlpatterns = patterns('',
    88    (r'^login/$', 'django.contrib.auth.views.login'),
  • django/contrib/comments/urls.py

    diff --git a/django/contrib/comments/urls.py b/django/contrib/comments/urls.py
    index d903779..69a0222 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, url
    22
    33urlpatterns = patterns('django.contrib.comments.views',
    44    url(r'^post/$',          'comments.post_comment',       name='comments-post-comment'),
  • django/contrib/databrowse/urls.py

    diff --git a/django/contrib/databrowse/urls.py b/django/contrib/databrowse/urls.py
    index 9b85d14..5c431de 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns
    22from django.contrib.databrowse import views
    33
    44# Note: The views in this URLconf all require a 'models' argument,
  • django/contrib/flatpages/tests/urls.py

    diff --git a/django/contrib/flatpages/tests/urls.py b/django/contrib/flatpages/tests/urls.py
    index 3cffd09..e0e7a07 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, include
    22
    33# special urls for flatpage test cases
    44urlpatterns = patterns('',
  • django/contrib/flatpages/urls.py

    diff --git a/django/contrib/flatpages/urls.py b/django/contrib/flatpages/urls.py
    index 4928930..5abb8e1 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns
    22
    33urlpatterns = patterns('django.contrib.flatpages.views',
    44    (r'^(?P<url>.*)$', 'flatpage'),
  • django/contrib/formtools/tests/urls.py

    diff --git a/django/contrib/formtools/tests/urls.py b/django/contrib/formtools/tests/urls.py
    index b89b6e6..abdab5b 100644
    a b  
    22This is a URLconf to be loaded by tests.py. Add any URLs needed for tests only.
    33"""
    44
    5 from django.conf.urls.defaults import *
     5from django.conf.urls import patterns
    66from django.contrib.formtools.tests import *
    77
    88urlpatterns = patterns('',
  • django/contrib/gis/tests/geoapp/urls.py

    diff --git a/django/contrib/gis/tests/geoapp/urls.py b/django/contrib/gis/tests/geoapp/urls.py
    index edaf280..6a64430 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns
    22from feeds import feed_dict
    33
    44urlpatterns = patterns('',
  • django/contrib/gis/tests/urls.py

    diff --git a/django/contrib/gis/tests/urls.py b/django/contrib/gis/tests/urls.py
    index 95e36c2..1520841 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, include
    22
    33urlpatterns = patterns('',
    44                       (r'^geoapp/', include('django.contrib.gis.tests.geoapp.urls')),
  • django/contrib/messages/tests/urls.py

    diff --git a/django/contrib/messages/tests/urls.py b/django/contrib/messages/tests/urls.py
    index 6252adc..7a80ce6 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns
    22from django.contrib import messages
    33from django.core.urlresolvers import reverse
    44from django.http import HttpResponseRedirect, HttpResponse
  • django/contrib/sitemaps/tests/urls.py

    diff --git a/django/contrib/sitemaps/tests/urls.py b/django/contrib/sitemaps/tests/urls.py
    index 6cdba36..89ec91d 100644
    a b  
    11from datetime import datetime
    2 from django.conf.urls.defaults import *
     2from django.conf.urls import patterns
    33from django.contrib.sitemaps import Sitemap, GenericSitemap, FlatPageSitemap
    44from django.contrib.auth.models import User
    55
  • django/contrib/staticfiles/urls.py

    diff --git a/django/contrib/staticfiles/urls.py b/django/contrib/staticfiles/urls.py
    index 70f04f2..090bd89 100644
    a b  
    11import re
    22from django.conf import settings
    3 from django.conf.urls.defaults import patterns, url, include
     3from django.conf.urls import patterns, url, include
    44from django.core.exceptions import ImproperlyConfigured
    55
    66urlpatterns = []
  • docs/intro/overview.txt

    diff --git a/docs/intro/overview.txt b/docs/intro/overview.txt
    index 34572a6..737db21 100644
    a b decouple URLs from Python code.  
    176176Here's what a URLconf might look like for the ``Reporter``/``Article``
    177177example above::
    178178
    179     from django.conf.urls.defaults import *
     179    from django.conf.urls import patterns, url, include
    180180
    181181    urlpatterns = patterns('',
    182182        (r'^articles/(\d{4})/$', 'news.views.year_archive'),
  • docs/intro/tutorial02.txt

    diff --git a/docs/intro/tutorial02.txt b/docs/intro/tutorial02.txt
    index c80d87d..b003ab6 100644
    a b activate the admin site for your installation, do these three things:  
    4343
    4444      .. parsed-literal::
    4545
    46           from django.conf.urls.defaults import *
     46          from django.conf.urls import patterns, url, include
    4747
    4848          # Uncomment the next two lines to enable the admin:
    4949          **from django.contrib import admin**
  • docs/intro/tutorial03.txt

    diff --git a/docs/intro/tutorial03.txt b/docs/intro/tutorial03.txt
    index 0843d9e..1248c70 100644
    a b point at that file::  
    7878
    7979Time for an example. Edit ``mysite/urls.py`` so it looks like this::
    8080
    81     from django.conf.urls.defaults import *
     81    from django.conf.urls import patterns, url, include
    8282
    8383    from django.contrib import admin
    8484    admin.autodiscover()
    It's just a normal view.  
    366366You normally won't have to bother with writing 404 views. By default, URLconfs
    367367have the following line up top::
    368368
    369     from django.conf.urls.defaults import *
     369    from django.conf.urls import patterns, url, include
    370370
    371371That takes care of setting ``handler404`` in the current module. As you can see
    372372in ``django/conf/urls/defaults.py``, ``handler404`` is set to
    callback in your URLconf, you can concatenate multiple  
    459459:func:`~django.conf.urls.defaults.patterns`. Your full ``mysite/urls.py`` might
    460460now look like this::
    461461
    462     from django.conf.urls.defaults import *
     462    from django.conf.urls import patterns, url, include
    463463
    464464    from django.contrib import admin
    465465    admin.autodiscover()
    Copy the file ``mysite/urls.py`` to ``polls/urls.py``. Then, change  
    496496:func:`~django.conf.urls.defaults.include`, leaving you with::
    497497
    498498    # This also imports the include function
    499     from django.conf.urls.defaults import *
     499    from django.conf.urls import patterns, url, include
    500500   
    501501    from django.contrib import admin
    502502    admin.autodiscover()
    URLconf by removing the leading "polls/" from each line, and removing the  
    526526lines registering the admin site. Your ``polls.urls`` file should now look like
    527527this::
    528528
    529     from django.conf.urls.defaults import *
     529    from django.conf.urls import patterns, url, include
    530530
    531531    urlpatterns = patterns('polls.views',
    532532        (r'^$', 'index'),
  • docs/intro/tutorial04.txt

    diff --git a/docs/intro/tutorial04.txt b/docs/intro/tutorial04.txt
    index 606da56..b4dfefe 100644
    a b Read on for details.  
    220220First, open the ``polls/urls.py`` URLconf. It looks like this, according to the
    221221tutorial so far::
    222222
    223     from django.conf.urls.defaults import *
     223    from django.conf.urls import patterns, url, include
    224224
    225225    urlpatterns = patterns('polls.views',
    226226        (r'^$', 'index'),
    tutorial so far::  
    231231
    232232Change it like so::
    233233
    234     from django.conf.urls.defaults import *
     234    from django.conf.urls import patterns, url, include
    235235    from django.views.generic import DetailView, ListView
    236236    from polls.models import Poll
    237237
  • docs/ref/contrib/admin/index.txt

    diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
    index ac517e8..e357115 100644
    a b In this example, we register the default ``AdminSite`` instance  
    14721472``django.contrib.admin.site`` at the URL ``/admin/`` ::
    14731473
    14741474    # urls.py
    1475     from django.conf.urls.defaults import *
     1475    from django.conf.urls import patterns, url, include
    14761476    from django.contrib import admin
    14771477
    14781478    admin.autodiscover()
    In this example, we register the ``AdminSite`` instance  
    14881488``myproject.admin.admin_site`` at the URL ``/myadmin/`` ::
    14891489
    14901490    # urls.py
    1491     from django.conf.urls.defaults import *
     1491    from django.conf.urls import patterns, url, include
    14921492    from myproject.admin import admin_site
    14931493
    14941494    urlpatterns = patterns('',
    separate versions of the admin site -- using the ``AdminSite`` instances  
    15161516respectively::
    15171517
    15181518    # urls.py
    1519     from django.conf.urls.defaults import *
     1519    from django.conf.urls import patterns, url, include
    15201520    from myproject.admin import basic_site, advanced_site
    15211521
    15221522    urlpatterns = patterns('',
  • docs/ref/contrib/comments/example.txt

    diff --git a/docs/ref/contrib/comments/example.txt b/docs/ref/contrib/comments/example.txt
    index 424bdb1..405a3d7 100644
    a b enable it in your project's ``urls.py``:  
    140140
    141141.. code-block:: python
    142142
    143   from django.conf.urls.defaults import *
     143  from django.conf.urls import patterns, url, include
    144144  from django.contrib.comments.feeds import LatestCommentFeed
    145145
    146146  feeds = {
  • docs/ref/contrib/formtools/form-wizard.txt

    diff --git a/docs/ref/contrib/formtools/form-wizard.txt b/docs/ref/contrib/formtools/form-wizard.txt
    index 370fbdc..9b19e2b 100644
    a b deploy the new :class:`FormWizard` object a URL in ``urls.py``. The  
    192192wizard takes a list of your :class:`~django.forms.Form` objects as
    193193arguments when you instantiate the Wizard::
    194194
    195     from django.conf.urls.defaults import *
     195    from django.conf.urls import patterns, url, include
    196196    from testapp.forms import ContactForm1, ContactForm2, ContactWizard
    197197
    198198    urlpatterns = patterns('',
  • docs/ref/contrib/gis/tutorial.txt

    diff --git a/docs/ref/contrib/gis/tutorial.txt b/docs/ref/contrib/gis/tutorial.txt
    index 9deeb78..6bb32a3 100644
    a b Let's dive in again -- create a file called ``admin.py`` inside the  
    702702Next, edit your ``urls.py`` in the ``geodjango`` project folder to look
    703703as follows::
    704704
    705     from django.conf.urls.defaults import *
     705    from django.conf.urls import patterns, url, include
    706706    from django.contrib.gis import admin
    707707
    708708    admin.autodiscover()
  • docs/ref/contrib/sitemaps.txt

    diff --git a/docs/ref/contrib/sitemaps.txt b/docs/ref/contrib/sitemaps.txt
    index b58b55c..422db08 100644
    a b Example  
    241241
    242242Here's an example of a :doc:`URLconf </topics/http/urls>` using both::
    243243
    244     from django.conf.urls.defaults import *
     244    from django.conf.urls import patterns, url, include
    245245    from django.contrib.sitemaps import FlatPageSitemap, GenericSitemap
    246246    from blog.models import Entry
    247247
  • docs/ref/contrib/syndication.txt

    diff --git a/docs/ref/contrib/syndication.txt b/docs/ref/contrib/syndication.txt
    index 04f14b5..bad998b 100644
    a b latest five news items::  
    8080To connect a URL to this feed, put an instance of the Feed object in
    8181your :doc:`URLconf </topics/http/urls>`. For example::
    8282
    83     from django.conf.urls.defaults import *
     83    from django.conf.urls import patterns, url, include
    8484    from myproject.feeds import LatestEntriesFeed
    8585
    8686    urlpatterns = patterns('',
    Here's a full example::  
    327327
    328328And the accompanying URLconf::
    329329
    330     from django.conf.urls.defaults import *
     330    from django.conf.urls import patterns, url, include
    331331    from myproject.feeds import RssSiteNewsFeed, AtomSiteNewsFeed
    332332
    333333    urlpatterns = patterns('',
  • docs/ref/models/instances.txt

    diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt
    index 88fd4e1..28105e9 100644
    a b reference the name rather than the view function. A named URL  
    506506pattern is defined by replacing the pattern tuple by a call to
    507507the ``url`` function)::
    508508
    509     from django.conf.urls.defaults import *
     509    from django.conf.urls import patterns, url, include
    510510
    511511    url(r'^people/(\d+)/$',
    512512        'django.views.generic.list_detail.object_detail',
  • docs/topics/class-based-views.txt

    diff --git a/docs/topics/class-based-views.txt b/docs/topics/class-based-views.txt
    index f0e4910..867c2ee 100644
    a b views themselves are classes, we point the URL to the as_view class method  
    7575instead, which is the entrypoint for class-based views::
    7676
    7777    # urls.py
    78     from django.conf.urls.defaults import *
     78    from django.conf.urls import patterns, url, include
    7979    from some_app.views import AboutView
    8080
    8181    urlpatterns = patterns('',
    Alternatively, if you're only changing a few simple attributes on a  
    8686class-based view, you can simply pass the new attributes into the as_view
    8787method call itself::
    8888
    89     from django.conf.urls.defaults import *
     89    from django.conf.urls import patterns, url, include
    9090    from django.views.generic import TemplateView
    9191
    9292    urlpatterns = patterns('',
    be using these models::  
    135135
    136136To build a list page of all publishers, we'd use a URLconf along these lines::
    137137
    138     from django.conf.urls.defaults import *
     138    from django.conf.urls import patterns, url, include
    139139    from django.views.generic import ListView
    140140    from books.models import Publisher
    141141
  • docs/topics/generic-views.txt

    diff --git a/docs/topics/generic-views.txt b/docs/topics/generic-views.txt
    index 41e32c8..c1f52d1 100644
    a b URLconf tuple for a given pattern.  
    4848For example, here's a simple URLconf you could use to present a static "about"
    4949page::
    5050
    51     from django.conf.urls.defaults import *
     51    from django.conf.urls import patterns, url, include
    5252    from django.views.generic.simple import direct_to_template
    5353
    5454    urlpatterns = patterns('',
    the URLconf to point to a view function:  
    7070
    7171.. parsed-literal::
    7272
    73     from django.conf.urls.defaults import *
     73    from django.conf.urls import patterns, url, include
    7474    from django.views.generic.simple import direct_to_template
    7575    **from books.views import about_pages**
    7676
    be using these models::  
    150150
    151151To build a list page of all publishers, we'd use a URLconf along these lines::
    152152
    153     from django.conf.urls.defaults import *
     153    from django.conf.urls import patterns, url, include
    154154    from django.views.generic import list_detail
    155155    from books.models import Publisher
    156156
  • docs/topics/http/urls.txt

    diff --git a/docs/topics/http/urls.txt b/docs/topics/http/urls.txt
    index 6179c30..54a00ba 100644
    a b algorithm the system follows to determine which Python code to execute:  
    4444
    4545    2. Django loads that Python module and looks for the variable
    4646       ``urlpatterns``. This should be a Python list, in the format returned by
    47        the function ``django.conf.urls.defaults.patterns()``.
     47       the function ``django.conf.urls.patterns()``.
    4848
    4949    3. Django runs through each URL pattern, in order, and stops at the first
    5050       one that matches the requested URL.
    Example  
    5959
    6060Here's a sample URLconf::
    6161
    62     from django.conf.urls.defaults import *
     62    from django.conf.urls import patterns, url, include
    6363
    6464    urlpatterns = patterns('',
    6565        (r'^articles/2003/$', 'news.views.special_case_2003'),
    Here's a sample URLconf::  
    7070
    7171Notes:
    7272
    73     * ``from django.conf.urls.defaults import *`` makes the ``patterns()``
    74       function available.
    75 
    7673    * To capture a value from the URL, just put parenthesis around it.
    7774
    7875    * There's no need to add a leading slash, because every URL has that. For
    Syntax of the urlpatterns variable  
    174171==================================
    175172
    176173``urlpatterns`` should be a Python list, in the format returned by the function
    177 ``django.conf.urls.defaults.patterns()``. Always use ``patterns()`` to create
     174``django.conf.urls.patterns()``. Always use ``patterns()`` to create
    178175the ``urlpatterns`` variable.
    179176
    180 Convention is to use ``from django.conf.urls.defaults import *`` at the top of
    181 your URLconf. This gives your module access to these objects:
     177``django.conf.urls`` also defines some other functions you'll want to use:
    182178
    183179patterns
    184180--------
    code duplication.  
    335331
    336332Here's the example URLconf from the :doc:`Django overview </intro/overview>`::
    337333
    338     from django.conf.urls.defaults import *
     334    from django.conf.urls import patterns, url, include
    339335
    340336    urlpatterns = patterns('',
    341337        (r'^articles/(\d{4})/$', 'news.views.year_archive'),
    each view function.  
    350346
    351347With this in mind, the above example can be written more concisely as::
    352348
    353     from django.conf.urls.defaults import *
     349    from django.conf.urls import patterns, url, include
    354350
    355351    urlpatterns = patterns('news.views',
    356352        (r'^articles/(\d{4})/$', 'year_archive'),
    Just add multiple ``patterns()`` objects together, like this:  
    371367
    372368Old::
    373369
    374     from django.conf.urls.defaults import *
     370    from django.conf.urls import patterns, url, include
    375371
    376372    urlpatterns = patterns('',
    377373        (r'^$', 'django.views.generic.date_based.archive_index'),
    Old::  
    381377
    382378New::
    383379
    384     from django.conf.urls.defaults import *
     380    from django.conf.urls import patterns, url, include
    385381
    386382    urlpatterns = patterns('django.views.generic.date_based',
    387383        (r'^$', 'archive_index'),
    essentially "roots" a set of URLs below other ones.  
    401397For example, here's the URLconf for the `Django Web site`_ itself. It includes a
    402398number of other URLconfs::
    403399
    404     from django.conf.urls.defaults import *
     400    from django.conf.urls import patterns, url, include
    405401
    406402    urlpatterns = patterns('',
    407403        (r'^weblog/',        include('django_website.apps.blog.urls.blog')),
    Another possibility is to include additional URL patterns not by specifying the  
    421417URLconf Python module defining them as the `include`_ argument but by using
    422418directly the pattern list as returned by `patterns`_ instead. For example::
    423419
    424     from django.conf.urls.defaults import *
     420    from django.conf.urls import patterns, url, include
    425421
    426422    extra_patterns = patterns('',
    427423        url(r'reports/(?P<id>\d+)/$', 'credit.views.report', name='credit-reports'),
  • docs/topics/http/views.txt

    diff --git a/docs/topics/http/views.txt b/docs/topics/http/views.txt
    index 399e6b6..0b946f7 100644
    a b URLconf, like so::  
    143143Behind the scenes, Django determines the 404 view by looking for ``handler404``.
    144144By default, URLconfs contain the following line::
    145145
    146     from django.conf.urls.defaults import *
     146    from django.conf.urls import patterns, url, include
    147147
    148148That takes care of setting ``handler404`` in the current module. As you can see
    149149in ``django/conf/urls/defaults.py``, ``handler404`` is set to
    URLconf, like so::  
    191191Behind the scenes, Django determines the error view by looking for ``handler500``.
    192192By default, URLconfs contain the following line::
    193193
    194     from django.conf.urls.defaults import *
     194    from django.conf.urls import patterns, url, include
    195195
    196196That takes care of setting ``handler500`` in the current module. As you can see
    197197in ``django/conf/urls/defaults.py``, ``handler500`` is set to
  • tests/modeltests/test_client/urls.py

    diff --git a/tests/modeltests/test_client/urls.py b/tests/modeltests/test_client/urls.py
    index 9e0eabe..9cdfe3e 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns
    22from django.views.generic.simple import redirect_to
    33import views
    44
  • tests/regressiontests/admin_views/customadmin.py

    diff --git a/tests/regressiontests/admin_views/customadmin.py b/tests/regressiontests/admin_views/customadmin.py
    index 34e39ef..1795b78 100644
    a b  
    11"""
    22A second, custom AdminSite -- see tests.CustomAdminSiteTests.
    33"""
    4 from django.conf.urls.defaults import patterns
     4from django.conf.urls import patterns
    55from django.contrib import admin
    66from django.http import HttpResponse
    77
  • tests/regressiontests/admin_views/urls.py

    diff --git a/tests/regressiontests/admin_views/urls.py b/tests/regressiontests/admin_views/urls.py
    index f3f1fbd..7320a3c 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, include
    22from django.contrib import admin
    33import views
    44import customadmin
  • tests/regressiontests/admin_widgets/urls.py

    diff --git a/tests/regressiontests/admin_widgets/urls.py b/tests/regressiontests/admin_widgets/urls.py
    index af73d53..9e6bc12 100644
    a b  
    1 
    2 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, include
    32import widgetadmin
    43
    54urlpatterns = patterns('',
  • tests/regressiontests/comment_tests/urls.py

    diff --git a/tests/regressiontests/comment_tests/urls.py b/tests/regressiontests/comment_tests/urls.py
    index 0058689..fe7285b 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, url
    22
    33urlpatterns = patterns('regressiontests.comment_tests.custom_comments.views',
    44    url(r'^post/$',          'custom_submit_comment'),
  • tests/regressiontests/comment_tests/urls_admin.py

    diff --git a/tests/regressiontests/comment_tests/urls_admin.py b/tests/regressiontests/comment_tests/urls_admin.py
    index 341285d..3c3813d 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, include
    22from django.contrib import admin
    33from django.contrib.comments.admin import CommentsAdmin
    44from django.contrib.comments.models import Comment
  • tests/regressiontests/conditional_processing/urls.py

    diff --git a/tests/regressiontests/conditional_processing/urls.py b/tests/regressiontests/conditional_processing/urls.py
    index 4dbe11a..738f890 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns
    22import views
    33
    44urlpatterns = patterns('',
  • tests/regressiontests/context_processors/urls.py

    diff --git a/tests/regressiontests/context_processors/urls.py b/tests/regressiontests/context_processors/urls.py
    index 30728c8..9c8a950 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, url
    22
    33import views
    44
  • tests/regressiontests/file_uploads/urls.py

    diff --git a/tests/regressiontests/file_uploads/urls.py b/tests/regressiontests/file_uploads/urls.py
    index 413080e..96b160e 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns
    22import views
    33
    44urlpatterns = patterns('',
  • tests/regressiontests/formwizard/urls.py

    diff --git a/tests/regressiontests/formwizard/urls.py b/tests/regressiontests/formwizard/urls.py
    index d964bc6..cdac27a 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, url
    22from forms import ContactWizard, Page1, Page2, Page3
    33
    44urlpatterns = patterns('',
  • tests/regressiontests/generic_inline_admin/urls.py

    diff --git a/tests/regressiontests/generic_inline_admin/urls.py b/tests/regressiontests/generic_inline_admin/urls.py
    index c3e8af8..f415872 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, include
    22from django.contrib import admin
    33
    44urlpatterns = patterns('',
  • tests/regressiontests/generic_views/urls.py

    diff --git a/tests/regressiontests/generic_views/urls.py b/tests/regressiontests/generic_views/urls.py
    index 548d10d..dd7d0df 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, url
    22from django.views.generic import TemplateView
    33
    44import views
  • tests/regressiontests/middleware/extra_urls.py

    diff --git a/tests/regressiontests/middleware/extra_urls.py b/tests/regressiontests/middleware/extra_urls.py
    index b2a8902..1aee48f 100644
    a b  
    1 from django.conf.urls.defaults import patterns
     1from django.conf.urls import patterns
    22
    33urlpatterns = patterns('',
    44    (r'^middleware/customurlconf/noslash$', 'view'),
  • tests/regressiontests/middleware/urls.py

    diff --git a/tests/regressiontests/middleware/urls.py b/tests/regressiontests/middleware/urls.py
    index 88a4b37..217e3ae 100644
    a b  
    1 from django.conf.urls.defaults import patterns
     1from django.conf.urls import patterns
    22
    33urlpatterns = patterns('',
    44    (r'^noslash$', 'view'),
  • tests/regressiontests/middleware_exceptions/urls.py

    diff --git a/tests/regressiontests/middleware_exceptions/urls.py b/tests/regressiontests/middleware_exceptions/urls.py
    index 5b477a4..bc1b328 100644
    a b  
    11# coding: utf-8
    2 from django.conf.urls.defaults import *
     2from django.conf.urls import patterns
    33
    44import views
    55
  • tests/regressiontests/special_headers/urls.py

    diff --git a/tests/regressiontests/special_headers/urls.py b/tests/regressiontests/special_headers/urls.py
    index c6b05d6..4f306fc 100644
    a b  
    11# coding: utf-8
    2 from django.conf.urls.defaults import *
     2from django.conf.urls import patterns
    33from django.views.generic.list_detail import object_detail
    44from models import Article
    55import views
  • tests/regressiontests/staticfiles_tests/urls/default.py

    diff --git a/tests/regressiontests/staticfiles_tests/urls/default.py b/tests/regressiontests/staticfiles_tests/urls/default.py
    index 061ec64..a453f9c 100644
    a b  
    11from django.conf import settings
    2 from django.conf.urls.defaults import *
     2from django.conf.urls import patterns, url
    33
    44urlpatterns = patterns('',
    55    url(r'^static/(?P<path>.*)$', 'django.contrib.staticfiles.views.serve'),
  • tests/regressiontests/syndication/urls.py

    diff --git a/tests/regressiontests/syndication/urls.py b/tests/regressiontests/syndication/urls.py
    index 881fa48..d57bd11 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns
    22
    33import feeds
    44
  • tests/regressiontests/templates/urls.py

    diff --git a/tests/regressiontests/templates/urls.py b/tests/regressiontests/templates/urls.py
    index 28d4133..96e1ea2 100644
    a b  
    11# coding: utf-8
    2 from django.conf.urls.defaults import *
     2from django.conf.urls import patterns, url
    33from regressiontests.templates import views
    44
    55urlpatterns = patterns('',
  • tests/regressiontests/test_client_regress/urls.py

    diff --git a/tests/regressiontests/test_client_regress/urls.py b/tests/regressiontests/test_client_regress/urls.py
    index 650d80b..3b4b351 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, url
    22from django.views.generic.simple import redirect_to
    33import views
    44
  • tests/regressiontests/urlpatterns_reverse/extra_urls.py

    diff --git a/tests/regressiontests/urlpatterns_reverse/extra_urls.py b/tests/regressiontests/urlpatterns_reverse/extra_urls.py
    index c171f6d..4dbfb90 100644
    a b  
    22Some extra URL patterns that are included at the top level.
    33"""
    44
    5 from django.conf.urls.defaults import *
     5from django.conf.urls import patterns, url, include
    66from views import empty_view
    77
    88urlpatterns = patterns('',
  • tests/regressiontests/urlpatterns_reverse/included_named_urls.py

    diff --git a/tests/regressiontests/urlpatterns_reverse/included_named_urls.py b/tests/regressiontests/urlpatterns_reverse/included_named_urls.py
    index b3f7903..32d2b29 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, url, include
    22from views import empty_view
    33
    44urlpatterns = patterns('',
  • tests/regressiontests/urlpatterns_reverse/included_named_urls2.py

    diff --git a/tests/regressiontests/urlpatterns_reverse/included_named_urls2.py b/tests/regressiontests/urlpatterns_reverse/included_named_urls2.py
    index 96c42c3..2a9779d 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, url
    22from views import empty_view
    33
    44urlpatterns = patterns('',
  • tests/regressiontests/urlpatterns_reverse/included_namespace_urls.py

    diff --git a/tests/regressiontests/urlpatterns_reverse/included_namespace_urls.py b/tests/regressiontests/urlpatterns_reverse/included_namespace_urls.py
    index 16887e2..c878f97 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, url, include
    22from namespace_urls import URLObject
    33from views import view_class_instance
    44
  • tests/regressiontests/urlpatterns_reverse/included_urls.py

    diff --git a/tests/regressiontests/urlpatterns_reverse/included_urls.py b/tests/regressiontests/urlpatterns_reverse/included_urls.py
    index f8acf34..ae2c626 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, url
    22from views import empty_view
    33
    44urlpatterns = patterns('',
  • tests/regressiontests/urlpatterns_reverse/included_urls2.py

    diff --git a/tests/regressiontests/urlpatterns_reverse/included_urls2.py b/tests/regressiontests/urlpatterns_reverse/included_urls2.py
    index f414ca6..b6fb4c6 100644
    a b each name to resolve and Django must distinguish the possibilities based on the  
    55argument list.
    66"""
    77
    8 from django.conf.urls.defaults import *
     8from django.conf.urls import patterns, url
    99from views import empty_view
    1010
    1111urlpatterns = patterns('',
  • tests/regressiontests/urlpatterns_reverse/named_urls.py

    diff --git a/tests/regressiontests/urlpatterns_reverse/named_urls.py b/tests/regressiontests/urlpatterns_reverse/named_urls.py
    index d8a61a1..fa71f53 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, url, include
    22from views import empty_view
    33
    44urlpatterns = patterns('',
  • tests/regressiontests/urlpatterns_reverse/namespace_urls.py

    diff --git a/tests/regressiontests/urlpatterns_reverse/namespace_urls.py b/tests/regressiontests/urlpatterns_reverse/namespace_urls.py
    index 3d34049..451bb68 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, url, include
    22from views import view_class_instance
    33
    44class URLObject(object):
  • tests/regressiontests/urlpatterns_reverse/no_urls.py

    diff --git a/tests/regressiontests/urlpatterns_reverse/no_urls.py b/tests/regressiontests/urlpatterns_reverse/no_urls.py
    index c9b9efe..5b1959c 100644
    a b  
    1 #from django.conf.urls.defaults import *
     1#from django.conf.urls import patterns, url, include
    22
  • tests/regressiontests/urlpatterns_reverse/urlconf_inner.py

    diff --git a/tests/regressiontests/urlpatterns_reverse/urlconf_inner.py b/tests/regressiontests/urlpatterns_reverse/urlconf_inner.py
    index d188e06..4543691 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, url
    22from django.template import Template, Context
    33from django.http import HttpResponse
    44
  • tests/regressiontests/urlpatterns_reverse/urlconf_outer.py

    diff --git a/tests/regressiontests/urlpatterns_reverse/urlconf_outer.py b/tests/regressiontests/urlpatterns_reverse/urlconf_outer.py
    index 506e036..0762fc5 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, url, include
    22
    33import urlconf_inner
    44
  • tests/regressiontests/urlpatterns_reverse/urls.py

    diff --git a/tests/regressiontests/urlpatterns_reverse/urls.py b/tests/regressiontests/urlpatterns_reverse/urls.py
    index c603c02..23d4af4 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, url, include
    22from views import empty_view, absolute_kwargs_view
    33
    44other_patterns = patterns('',
  • tests/regressiontests/urlpatterns_reverse/urls_error_handlers.py

    diff --git a/tests/regressiontests/urlpatterns_reverse/urls_error_handlers.py b/tests/regressiontests/urlpatterns_reverse/urls_error_handlers.py
    index c2e0d32..7a3e220 100644
    a b  
    11# Used by the ErrorHandlerResolutionTests test case.
    22
    3 from django.conf.urls.defaults import patterns
     3from django.conf.urls import patterns
    44
    55urlpatterns = patterns('')
    66
  • tests/regressiontests/urlpatterns_reverse/urls_error_handlers_callables.py

    diff --git a/tests/regressiontests/urlpatterns_reverse/urls_error_handlers_callables.py b/tests/regressiontests/urlpatterns_reverse/urls_error_handlers_callables.py
    index 00f25a7..c3d4855 100644
    a b  
    11# Used by the ErrorHandlerResolutionTests test case.
    22
    3 from django.conf.urls.defaults import patterns
     3from django.conf.urls import patterns
    44from views import empty_view
    55
    66urlpatterns = patterns('')
  • tests/regressiontests/urlpatterns_reverse/urls_without_full_import.py

    diff --git a/tests/regressiontests/urlpatterns_reverse/urls_without_full_import.py b/tests/regressiontests/urlpatterns_reverse/urls_without_full_import.py
    index 75a195e..0e58a15 100644
    a b  
    11# A URLs file that doesn't use the default
    2 # from django.conf.urls.defaults import *
     2# from django.conf.urls import *
    33# import pattern.
    4 from django.conf.urls.defaults import patterns, url
     4from django.conf.urls import patterns, url
    55from views import empty_view, bad_view
    66
    77urlpatterns = patterns('',
  • tests/regressiontests/utils/urls.py

    diff --git a/tests/regressiontests/utils/urls.py b/tests/regressiontests/utils/urls.py
    index ba09d14..9e90a64 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns
    22
    33import views
    44
  • tests/regressiontests/views/urls.py

    diff --git a/tests/regressiontests/views/urls.py b/tests/regressiontests/views/urls.py
    index d1412cd..2a70f73 100644
    a b  
    11# coding: utf-8
    22from os import path
    33
    4 from django.conf.urls.defaults import *
     4from django.conf.urls import patterns, url, include
    55
    66from models import *
    77import views
  • tests/urls.py

    diff --git a/tests/urls.py b/tests/urls.py
    index 01d6408..1009586 100644
    a b  
    1 from django.conf.urls.defaults import *
     1from django.conf.urls import patterns, include
    22
    33urlpatterns = patterns('',
    44    # test_client modeltest urls
Back to Top