-
diff --git a/django/conf/project_template/urls.py b/django/conf/project_template/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import patterns, include, url |
| 1 | from django.conf.urls import patterns, include, url |
2 | 2 | |
3 | 3 | # Uncomment the next two lines to enable the admin: |
4 | 4 | # from django.contrib import admin |
-
diff --git a/django/conf/urls/__init__.py b/django/conf/urls/__init__.py
a
|
b
|
|
| 1 | from django.conf.urls.defaults import * |
-
diff --git a/django/conf/urls/defaults.py b/django/conf/urls/defaults.py
a
|
b
|
|
4 | 4 | from django.utils.importlib import import_module |
5 | 5 | |
6 | 6 | |
7 | | __all__ = ['handler404', 'handler500', 'include', 'patterns', 'url'] |
| 7 | __all__ = ['handler403', 'handler404', 'handler500', 'include', 'patterns', 'url'] |
8 | 8 | |
9 | 9 | handler403 = 'django.views.defaults.permission_denied' |
10 | 10 | handler404 = 'django.views.defaults.page_not_found' |
-
diff --git a/django/conf/urls/i18n.py b/django/conf/urls/i18n.py
a
|
b
|
|
1 | 1 | from django.conf import settings |
2 | | from django.conf.urls.defaults import patterns |
| 2 | from django.conf.urls import patterns |
3 | 3 | from django.core.urlresolvers import LocaleRegexURLResolver |
4 | 4 | |
5 | 5 | def i18n_patterns(prefix, *args): |
-
diff --git a/django/conf/urls/shortcut.py b/django/conf/urls/shortcut.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns |
2 | 2 | |
3 | 3 | urlpatterns = patterns('django.views', |
4 | 4 | (r'^(?P<content_type_id>\d+)/(?P<object_id>.*)/$', 'defaults.shortcut'), |
-
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
a
|
b
|
|
319 | 319 | super(ModelAdmin, self).__init__() |
320 | 320 | |
321 | 321 | def get_urls(self): |
322 | | from django.conf.urls.defaults import patterns, url |
| 322 | from django.conf.urls import patterns, url |
323 | 323 | |
324 | 324 | def wrap(view): |
325 | 325 | def wrapper(*args, **kwargs): |
-
diff --git a/django/contrib/admin/sites.py b/django/contrib/admin/sites.py
a
|
b
|
|
174 | 174 | class MyAdminSite(AdminSite): |
175 | 175 | |
176 | 176 | def get_urls(self): |
177 | | from django.conf.urls.defaults import patterns, url |
| 177 | from django.conf.urls import patterns, url |
178 | 178 | |
179 | 179 | urls = super(MyAdminSite, self).get_urls() |
180 | 180 | urls += patterns('', |
… |
… |
|
199 | 199 | return update_wrapper(inner, view) |
200 | 200 | |
201 | 201 | def get_urls(self): |
202 | | from django.conf.urls.defaults import patterns, url, include |
| 202 | from django.conf.urls import patterns, url, include |
203 | 203 | |
204 | 204 | if settings.DEBUG: |
205 | 205 | self.check_dependencies() |
-
diff --git a/django/contrib/admindocs/urls.py b/django/contrib/admindocs/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, url |
2 | 2 | from django.contrib.admindocs import views |
3 | 3 | |
4 | 4 | urlpatterns = patterns('', |
-
diff --git a/django/contrib/auth/admin.py b/django/contrib/auth/admin.py
a
|
b
|
|
74 | 74 | return super(UserAdmin, self).get_form(request, obj, **defaults) |
75 | 75 | |
76 | 76 | def get_urls(self): |
77 | | from django.conf.urls.defaults import patterns |
| 77 | from django.conf.urls import patterns |
78 | 78 | return patterns('', |
79 | 79 | (r'^(\d+)/password/$', self.admin_site.admin_view(self.user_change_password)) |
80 | 80 | ) + super(UserAdmin, self).get_urls() |
-
diff --git a/django/contrib/auth/tests/urls.py b/django/contrib/auth/tests/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import patterns, url |
| 1 | from django.conf.urls import patterns, url |
2 | 2 | from django.contrib.auth import context_processors |
3 | 3 | from django.contrib.auth.urls import urlpatterns |
4 | 4 | from django.contrib.auth.views import password_reset |
-
diff --git a/django/contrib/auth/urls.py b/django/contrib/auth/urls.py
a
|
b
|
|
2 | 2 | # provided as a convenience to those who want to deploy these URLs elsewhere. |
3 | 3 | # This file is also used to provide a reliable view deployment for test purposes. |
4 | 4 | |
5 | | from django.conf.urls.defaults import * |
| 5 | from django.conf.urls import patterns |
6 | 6 | |
7 | 7 | urlpatterns = patterns('', |
8 | 8 | (r'^login/$', 'django.contrib.auth.views.login'), |
-
diff --git a/django/contrib/comments/urls.py b/django/contrib/comments/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, url |
2 | 2 | |
3 | 3 | urlpatterns = patterns('django.contrib.comments.views', |
4 | 4 | url(r'^post/$', 'comments.post_comment', name='comments-post-comment'), |
-
diff --git a/django/contrib/databrowse/urls.py b/django/contrib/databrowse/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns |
2 | 2 | from django.contrib.databrowse import views |
3 | 3 | |
4 | 4 | # Note: The views in this URLconf all require a 'models' argument, |
-
diff --git a/django/contrib/flatpages/tests/urls.py b/django/contrib/flatpages/tests/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, include |
2 | 2 | |
3 | 3 | # special urls for flatpage test cases |
4 | 4 | urlpatterns = patterns('', |
-
diff --git a/django/contrib/flatpages/urls.py b/django/contrib/flatpages/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns |
2 | 2 | |
3 | 3 | urlpatterns = patterns('django.contrib.flatpages.views', |
4 | 4 | (r'^(?P<url>.*)$', 'flatpage'), |
-
diff --git a/django/contrib/formtools/tests/urls.py b/django/contrib/formtools/tests/urls.py
a
|
b
|
|
2 | 2 | This is a URLconf to be loaded by tests.py. Add any URLs needed for tests only. |
3 | 3 | """ |
4 | 4 | |
5 | | from django.conf.urls.defaults import * |
| 5 | from django.conf.urls import patterns, url |
6 | 6 | from django.contrib.formtools.tests import TestFormPreview, TestWizardClass |
7 | 7 | |
8 | 8 | from forms import (ContactWizard, Page1, Page2, Page3, TestForm, |
-
diff --git a/django/contrib/formtools/tests/wizard/namedwizardtests/urls.py b/django/contrib/formtools/tests/wizard/namedwizardtests/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import patterns, url |
| 1 | from django.conf.urls import patterns, url |
2 | 2 | from django.contrib.formtools.tests.wizard.namedwizardtests.forms import ( |
3 | 3 | SessionContactWizard, CookieContactWizard, Page1, Page2, Page3, Page4) |
4 | 4 | |
-
diff --git a/django/contrib/formtools/tests/wizard/wizardtests/urls.py b/django/contrib/formtools/tests/wizard/wizardtests/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, url |
2 | 2 | from django.contrib.formtools.tests.wizard.wizardtests.forms import ( |
3 | 3 | SessionContactWizard, CookieContactWizard, Page1, Page2, Page3, Page4) |
4 | 4 | |
-
diff --git a/django/contrib/gis/tests/geoapp/urls.py b/django/contrib/gis/tests/geoapp/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns |
2 | 2 | from feeds import feed_dict |
3 | 3 | |
4 | 4 | urlpatterns = patterns('', |
-
diff --git a/django/contrib/messages/tests/urls.py b/django/contrib/messages/tests/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns |
2 | 2 | from django.contrib import messages |
3 | 3 | from django.core.urlresolvers import reverse |
4 | 4 | from django.http import HttpResponseRedirect, HttpResponse |
-
diff --git a/django/contrib/sitemaps/tests/urls.py b/django/contrib/sitemaps/tests/urls.py
a
|
b
|
|
1 | 1 | from datetime import datetime |
2 | | from django.conf.urls.defaults import * |
| 2 | from django.conf.urls import patterns |
3 | 3 | from django.contrib.sitemaps import Sitemap, GenericSitemap, FlatPageSitemap |
4 | 4 | from django.contrib.auth.models import User |
5 | 5 | |
-
diff --git a/docs/intro/overview.txt b/docs/intro/overview.txt
a
|
b
|
|
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.defaults import * |
| 179 | from django.conf.urls import patterns, url, include |
180 | 180 | |
181 | 181 | urlpatterns = patterns('', |
182 | 182 | (r'^articles/(\d{4})/$', 'news.views.year_archive'), |
-
diff --git a/docs/intro/tutorial02.txt b/docs/intro/tutorial02.txt
a
|
b
|
|
40 | 40 | |
41 | 41 | .. parsed-literal:: |
42 | 42 | |
43 | | from django.conf.urls.defaults import patterns, include, url |
| 43 | from django.conf.urls import patterns, include, url |
44 | 44 | |
45 | 45 | # Uncomment the next two lines to enable the admin: |
46 | 46 | **from django.contrib import admin** |
-
diff --git a/docs/intro/tutorial03.txt b/docs/intro/tutorial03.txt
a
|
b
|
|
78 | 78 | |
79 | 79 | Time for an example. Edit ``mysite/urls.py`` so it looks like this:: |
80 | 80 | |
81 | | from django.conf.urls.defaults import patterns, include, url |
| 81 | from django.conf.urls import patterns, include, url |
82 | 82 | |
83 | 83 | from django.contrib import admin |
84 | 84 | admin.autodiscover() |
… |
… |
|
366 | 366 | You normally won't have to bother with writing 404 views. By default, URLconfs |
367 | 367 | have the following line up top:: |
368 | 368 | |
369 | | from django.conf.urls.defaults import patterns, include, url |
| 369 | from django.conf.urls import patterns, include, url |
370 | 370 | |
371 | 371 | That takes care of setting ``handler404`` in the current module. As you can see |
372 | 372 | in ``django/conf/urls/defaults.py``, ``handler404`` is set to |
… |
… |
|
442 | 442 | |
443 | 443 | Because this is a common case, the URLconf framework provides a shortcut for |
444 | 444 | common prefixes. You can factor out the common prefixes and add them as the |
445 | | first argument to :func:`~django.conf.urls.defaults.patterns`, like so:: |
| 445 | first argument to :func:`~django.conf.urls.patterns`, like so:: |
446 | 446 | |
447 | 447 | urlpatterns = patterns('polls.views', |
448 | 448 | (r'^polls/$', 'index'), |
… |
… |
|
456 | 456 | |
457 | 457 | Since you generally don't want the prefix for one app to be applied to every |
458 | 458 | callback in your URLconf, you can concatenate multiple |
459 | | :func:`~django.conf.urls.defaults.patterns`. Your full ``mysite/urls.py`` might |
| 459 | :func:`~django.conf.urls.patterns`. Your full ``mysite/urls.py`` might |
460 | 460 | now look like this:: |
461 | 461 | |
462 | | from django.conf.urls.defaults import patterns, include, url |
| 462 | from django.conf.urls import patterns, include, url |
463 | 463 | |
464 | 464 | from django.contrib import admin |
465 | 465 | admin.autodiscover() |
466 | | |
| 466 | |
467 | 467 | urlpatterns = patterns('polls.views', |
468 | 468 | (r'^polls/$', 'index'), |
469 | 469 | (r'^polls/(?P<poll_id>\d+)/$', 'detail'), |
470 | 470 | (r'^polls/(?P<poll_id>\d+)/results/$', 'results'), |
471 | 471 | (r'^polls/(?P<poll_id>\d+)/vote/$', 'vote'), |
472 | 472 | ) |
473 | | |
| 473 | |
474 | 474 | urlpatterns += patterns('', |
475 | 475 | url(r'^admin/', include(admin.site.urls)), |
476 | 476 | ) |
… |
… |
|
493 | 493 | |
494 | 494 | Copy the file ``mysite/urls.py`` to ``polls/urls.py``. Then, change |
495 | 495 | ``mysite/urls.py`` to remove the poll-specific URLs and insert an |
496 | | :func:`~django.conf.urls.defaults.include`, leaving you with:: |
| 496 | :func:`~django.conf.urls.include`, leaving you with:: |
497 | 497 | |
498 | 498 | # This also imports the include function |
499 | | from django.conf.urls.defaults import patterns, include, url |
500 | | |
| 499 | from django.conf.urls import patterns, include, url |
| 500 | |
501 | 501 | from django.contrib import admin |
502 | 502 | admin.autodiscover() |
503 | | |
| 503 | |
504 | 504 | urlpatterns = patterns('', |
505 | 505 | (r'^polls/', include('polls.urls')), |
506 | 506 | url(r'^admin/', include(admin.site.urls)), |
507 | 507 | ) |
508 | 508 | |
509 | | :func:`~django.conf.urls.defaults.include` simply references another URLconf. |
| 509 | :func:`~django.conf.urls.include` simply references another URLconf. |
510 | 510 | Note that the regular expression doesn't have a ``$`` (end-of-string match |
511 | 511 | character) but has the trailing slash. Whenever Django encounters |
512 | | :func:`~django.conf.urls.defaults.include`, it chops off whatever part of the |
| 512 | :func:`~django.conf.urls.include`, it chops off whatever part of the |
513 | 513 | URL matched up to that point and sends the remaining string to the included |
514 | 514 | URLconf for further processing. |
515 | 515 | |
… |
… |
|
526 | 526 | lines registering the admin site. Your ``polls/urls.py`` file should now look like |
527 | 527 | this:: |
528 | 528 | |
529 | | from django.conf.urls.defaults import patterns, include, url |
| 529 | from django.conf.urls import patterns, include, url |
530 | 530 | |
531 | 531 | urlpatterns = patterns('polls.views', |
532 | 532 | (r'^$', 'index'), |
… |
… |
|
535 | 535 | (r'^(?P<poll_id>\d+)/vote/$', 'vote'), |
536 | 536 | ) |
537 | 537 | |
538 | | The idea behind :func:`~django.conf.urls.defaults.include` and URLconf |
| 538 | The idea behind :func:`~django.conf.urls.include` and URLconf |
539 | 539 | decoupling is to make it easy to plug-and-play URLs. Now that polls are in their |
540 | 540 | own URLconf, they can be placed under "/polls/", or under "/fun_polls/", or |
541 | 541 | under "/content/polls/", or any other path root, and the app will still work. |
-
diff --git a/docs/intro/tutorial04.txt b/docs/intro/tutorial04.txt
a
|
b
|
|
218 | 218 | First, open the ``polls/urls.py`` URLconf. It looks like this, according to the |
219 | 219 | tutorial so far:: |
220 | 220 | |
221 | | from django.conf.urls.defaults import patterns, include, url |
| 221 | from django.conf.urls import patterns, include, url |
222 | 222 | |
223 | 223 | urlpatterns = patterns('polls.views', |
224 | 224 | (r'^$', 'index'), |
… |
… |
|
229 | 229 | |
230 | 230 | Change it like so:: |
231 | 231 | |
232 | | from django.conf.urls.defaults import patterns, include, url |
| 232 | from django.conf.urls import patterns, include, url |
233 | 233 | from django.views.generic import DetailView, ListView |
234 | 234 | from polls.models import Poll |
235 | 235 | |
… |
… |
|
269 | 269 | that we have a way to refer to its URL later on (see the |
270 | 270 | documentation about :ref:`naming URL patterns |
271 | 271 | <naming-url-patterns>` for information). We're also using the |
272 | | :func:`~django.conf.urls.default.url` function from |
273 | | :mod:`django.conf.urls.defaults` here. It's a good habit to use |
274 | | :func:`~django.conf.urls.defaults.url` when you are providing a |
| 272 | :func:`~django.conf.urls.url` function from |
| 273 | :mod:`django.conf.urls` here. It's a good habit to use |
| 274 | :func:`~django.conf.urls.url` when you are providing a |
275 | 275 | pattern name like this. |
276 | 276 | |
277 | 277 | By default, the :class:`~django.views.generic.list.DetailView` generic |
-
diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt
a
|
b
|
|
1821 | 1821 | ``django.contrib.admin.site`` at the URL ``/admin/`` :: |
1822 | 1822 | |
1823 | 1823 | # urls.py |
1824 | | from django.conf.urls.defaults import * |
| 1824 | from django.conf.urls import patterns, url, include |
1825 | 1825 | from django.contrib import admin |
1826 | 1826 | |
1827 | 1827 | admin.autodiscover() |
… |
… |
|
1837 | 1837 | ``myproject.admin.admin_site`` at the URL ``/myadmin/`` :: |
1838 | 1838 | |
1839 | 1839 | # urls.py |
1840 | | from django.conf.urls.defaults import * |
| 1840 | from django.conf.urls import patterns, url, include |
1841 | 1841 | from myproject.admin import admin_site |
1842 | 1842 | |
1843 | 1843 | urlpatterns = patterns('', |
… |
… |
|
1861 | 1861 | respectively:: |
1862 | 1862 | |
1863 | 1863 | # urls.py |
1864 | | from django.conf.urls.defaults import * |
| 1864 | from django.conf.urls import patterns, url, include |
1865 | 1865 | from myproject.admin import basic_site, advanced_site |
1866 | 1866 | |
1867 | 1867 | urlpatterns = patterns('', |
-
diff --git a/docs/ref/contrib/comments/example.txt b/docs/ref/contrib/comments/example.txt
a
|
b
|
|
143 | 143 | |
144 | 144 | .. code-block:: python |
145 | 145 | |
146 | | from django.conf.urls.defaults import * |
| 146 | from django.conf.urls import patterns, url, include |
147 | 147 | from django.contrib.comments.feeds import LatestCommentFeed |
148 | 148 | |
149 | 149 | urlpatterns = patterns('', |
… |
… |
|
161 | 161 | |
162 | 162 | .. code-block:: python |
163 | 163 | |
164 | | from django.conf.urls.defaults import * |
| 164 | from django.conf.urls import patterns |
165 | 165 | from django.contrib.comments.feeds import LatestCommentFeed |
166 | 166 | |
167 | 167 | feeds = { |
-
diff --git a/docs/ref/contrib/formtools/form-wizard.txt b/docs/ref/contrib/formtools/form-wizard.txt
a
|
b
|
|
217 | 217 | wizard's :meth:`as_view` method takes a list of your |
218 | 218 | :class:`~django.forms.Form` classes as an argument during instantiation:: |
219 | 219 | |
220 | | from django.conf.urls.defaults import patterns |
| 220 | from django.conf.urls import patterns |
221 | 221 | |
222 | 222 | from myapp.forms import ContactForm1, ContactForm2 |
223 | 223 | from myapp.views import ContactWizard |
… |
… |
|
525 | 525 | |
526 | 526 | We need to add the ``ContactWizard`` to our ``urls.py`` file:: |
527 | 527 | |
528 | | from django.conf.urls.defaults import pattern |
| 528 | from django.conf.urls import pattern |
529 | 529 | |
530 | 530 | from myapp.forms import ContactForm1, ContactForm2 |
531 | 531 | from myapp.views import ContactWizard, show_message_form_condition |
… |
… |
|
572 | 572 | |
573 | 573 | Example code for the changed ``urls.py`` file:: |
574 | 574 | |
575 | | from django.conf.urls.defaults import url, patterns |
| 575 | from django.conf.urls import url, patterns |
576 | 576 | |
577 | 577 | from myapp.forms import ContactForm1, ContactForm2 |
578 | 578 | from myapp.views import ContactWizard |
-
diff --git a/docs/ref/contrib/gis/tutorial.txt b/docs/ref/contrib/gis/tutorial.txt
a
|
b
|
|
701 | 701 | Next, edit your ``urls.py`` in the ``geodjango`` project folder to look |
702 | 702 | as follows:: |
703 | 703 | |
704 | | from django.conf.urls.defaults import * |
| 704 | from django.conf.urls import patterns, url, include |
705 | 705 | from django.contrib.gis import admin |
706 | 706 | |
707 | 707 | admin.autodiscover() |
-
diff --git a/docs/ref/contrib/sitemaps.txt b/docs/ref/contrib/sitemaps.txt
a
|
b
|
|
241 | 241 | |
242 | 242 | Here's an example of a :doc:`URLconf </topics/http/urls>` using both:: |
243 | 243 | |
244 | | from django.conf.urls.defaults import * |
| 244 | from django.conf.urls import patterns, url, include |
245 | 245 | from django.contrib.sitemaps import FlatPageSitemap, GenericSitemap |
246 | 246 | from blog.models import Entry |
247 | 247 | |
-
diff --git a/docs/ref/contrib/syndication.txt b/docs/ref/contrib/syndication.txt
a
|
b
|
|
80 | 80 | To connect a URL to this feed, put an instance of the Feed object in |
81 | 81 | your :doc:`URLconf </topics/http/urls>`. For example:: |
82 | 82 | |
83 | | from django.conf.urls.defaults import * |
| 83 | from django.conf.urls import patterns, url, include |
84 | 84 | from myproject.feeds import LatestEntriesFeed |
85 | 85 | |
86 | 86 | urlpatterns = patterns('', |
… |
… |
|
327 | 327 | |
328 | 328 | And the accompanying URLconf:: |
329 | 329 | |
330 | | from django.conf.urls.defaults import * |
| 330 | from django.conf.urls import patterns, url, include |
331 | 331 | from myproject.feeds import RssSiteNewsFeed, AtomSiteNewsFeed |
332 | 332 | |
333 | 333 | urlpatterns = patterns('', |
-
diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt
a
|
b
|
|
526 | 526 | rather than the view function. A named URL pattern is defined by replacing the |
527 | 527 | pattern tuple by a call to the ``url`` function):: |
528 | 528 | |
529 | | from django.conf.urls.defaults import * |
| 529 | from django.conf.urls import patterns, url, include |
530 | 530 | |
531 | 531 | url(r'^people/(\d+)/$', 'blog_views.generic_detail', name='people_view'), |
532 | 532 | |
-
diff --git a/docs/releases/1.4.txt b/docs/releases/1.4.txt
a
|
b
|
|
279 | 279 | MySQL with the InnoDB database engine. |
280 | 280 | |
281 | 281 | * A new 403 response handler has been added as |
282 | | ``'django.views.defaults.permission_denied'``. See the documentation |
283 | | about :ref:`the 403 (HTTP Forbidden) view<http_forbidden_view>` for more |
284 | | information. |
| 282 | ``'django.views.defaults.permission_denied'``. You can set your own handler by |
| 283 | setting the value of :data:`django.conf.urls.handler403`. See the |
| 284 | documentation about :ref:`the 403 (HTTP Forbidden) view<http_forbidden_view>` |
| 285 | for more information. |
285 | 286 | |
286 | 287 | * The :ttag:`trans` template tag now takes an optional ``as`` argument to |
287 | 288 | be able to retrieve a translation string without displaying it but setting |
… |
… |
|
571 | 572 | |
572 | 573 | The existence of any ``'filters'`` key under the ``'mail_admins'`` handler will |
573 | 574 | disable this backward-compatibility shim and deprecation warning. |
| 575 | |
| 576 | ``django.conf.urls.defaults`` |
| 577 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 578 | |
| 579 | Until Django 1.3 the functions :func:`~django.conf.urls.include`, |
| 580 | :func:`~django.conf.urls.patterns` and :func:`~django.conf.urls.url` plus |
| 581 | :data:`~django.conf.urls.handler404`, :data:`~django.conf.urls.handler500` |
| 582 | were located in a ``django.conf.urls.defaults`` module. |
| 583 | |
| 584 | Starting with Django 1.4 they are now available in :mod:`django.conf.urls`. |
-
diff --git a/docs/topics/class-based-views.txt b/docs/topics/class-based-views.txt
a
|
b
|
|
75 | 75 | instead, which is the entry point for class-based views:: |
76 | 76 | |
77 | 77 | # urls.py |
78 | | from django.conf.urls.defaults import * |
| 78 | from django.conf.urls import patterns, url, include |
79 | 79 | from some_app.views import AboutView |
80 | 80 | |
81 | 81 | urlpatterns = patterns('', |
… |
… |
|
86 | 86 | class-based view, you can simply pass the new attributes into the ``as_view`` |
87 | 87 | method call itself:: |
88 | 88 | |
89 | | from django.conf.urls.defaults import * |
| 89 | from django.conf.urls import patterns, url, include |
90 | 90 | from django.views.generic import TemplateView |
91 | 91 | |
92 | 92 | urlpatterns = patterns('', |
… |
… |
|
135 | 135 | |
136 | 136 | To build a list page of all publishers, we'd use a URLconf along these lines:: |
137 | 137 | |
138 | | from django.conf.urls.defaults import * |
| 138 | from django.conf.urls import patterns, url, include |
139 | 139 | from django.views.generic import ListView |
140 | 140 | from books.models import Publisher |
141 | 141 | |
-
diff --git a/docs/topics/generic-views.txt b/docs/topics/generic-views.txt
a
|
b
|
|
58 | 58 | For example, here's a simple URLconf you could use to present a static "about" |
59 | 59 | page:: |
60 | 60 | |
61 | | from django.conf.urls.defaults import * |
| 61 | from django.conf.urls import patterns, url, include |
62 | 62 | from django.views.generic.simple import direct_to_template |
63 | 63 | |
64 | 64 | urlpatterns = patterns('', |
… |
… |
|
80 | 80 | |
81 | 81 | .. parsed-literal:: |
82 | 82 | |
83 | | from django.conf.urls.defaults import * |
| 83 | from django.conf.urls import patterns, url, include |
84 | 84 | from django.views.generic.simple import direct_to_template |
85 | 85 | **from books.views import about_pages** |
86 | 86 | |
… |
… |
|
160 | 160 | |
161 | 161 | To build a list page of all publishers, we'd use a URLconf along these lines:: |
162 | 162 | |
163 | | from django.conf.urls.defaults import * |
| 163 | from django.conf.urls import patterns, url, include |
164 | 164 | from django.views.generic import list_detail |
165 | 165 | from books.models import Publisher |
166 | 166 | |
-
diff --git a/docs/topics/http/urls.txt b/docs/topics/http/urls.txt
a
|
b
|
|
50 | 50 | |
51 | 51 | 2. Django loads that Python module and looks for the variable |
52 | 52 | ``urlpatterns``. This should be a Python list, in the format returned by |
53 | | the function :func:`django.conf.urls.defaults.patterns`. |
| 53 | the function :func:`django.conf.urls.patterns`. |
54 | 54 | |
55 | 55 | 3. Django runs through each URL pattern, in order, and stops at the first |
56 | 56 | one that matches the requested URL. |
… |
… |
|
65 | 65 | |
66 | 66 | Here's a sample URLconf:: |
67 | 67 | |
68 | | from django.conf.urls.defaults import * |
| 68 | from django.conf.urls import patterns, url, include |
69 | 69 | |
70 | 70 | urlpatterns = patterns('', |
71 | 71 | (r'^articles/2003/$', 'news.views.special_case_2003'), |
… |
… |
|
76 | 76 | |
77 | 77 | Notes: |
78 | 78 | |
79 | | * ``from django.conf.urls.defaults import *`` makes the ``patterns()`` |
80 | | function available. |
81 | | |
82 | 79 | * To capture a value from the URL, just put parenthesis around it. |
83 | 80 | |
84 | 81 | * There's no need to add a leading slash, because every URL has that. For |
… |
… |
|
180 | 177 | ================================== |
181 | 178 | |
182 | 179 | ``urlpatterns`` should be a Python list, in the format returned by the function |
183 | | :func:`django.conf.urls.defaults.patterns`. Always use ``patterns()`` to create |
| 180 | :func:`django.conf.urls.patterns`. Always use ``patterns()`` to create |
184 | 181 | the ``urlpatterns`` variable. |
185 | 182 | |
186 | | Convention is to use ``from django.conf.urls.defaults import *`` at the top of |
187 | | your URLconf. This gives your module access to these objects: |
| 183 | ``django.conf.urls`` also defines some other functions you'll want to use: |
188 | 184 | |
189 | | .. module:: django.conf.urls.defaults |
| 185 | .. module:: django.conf.urls |
| 186 | |
| 187 | .. versionchanged:: 1.4 |
| 188 | Starting with Django 1.4 `functions `patterns``, ``url``, ``include`` plus |
| 189 | the ``handler*`` symbols described below are now available in the |
| 190 | ``django.conf.urls`` module. |
| 191 | |
| 192 | Until Django 1.3 they were located in ``django.conf.urls.defaults``. For |
| 193 | the time being you still can import them from there. |
190 | 194 | |
191 | 195 | patterns |
192 | 196 | -------- |
… |
… |
|
252 | 256 | ``patterns()`` and is only relevant when you're passing a string as the |
253 | 257 | ``view`` parameter. |
254 | 258 | |
| 259 | handler403 |
| 260 | ---------- |
| 261 | |
| 262 | .. data:: handler403 |
| 263 | |
| 264 | A callable, or a string representing the full Python import path to the view |
| 265 | that should be called if the user has no the permissions required to access |
| 266 | a resource. |
| 267 | |
| 268 | By default, this is ``'django.views.defaults.permission_denied'``. That default |
| 269 | value should suffice. |
| 270 | |
| 271 | See the documentation about :ref:`the 403 (HTTP Forbidden) view |
| 272 | <http_forbidden_view>` for more information. |
| 273 | |
| 274 | .. versionadded:: 1.4 |
| 275 | ``handler403`` is new in Django 1.4. |
| 276 | |
255 | 277 | handler404 |
256 | 278 | ---------- |
257 | 279 | |
… |
… |
|
339 | 361 | |
340 | 362 | Here's the example URLconf from the :doc:`Django overview </intro/overview>`:: |
341 | 363 | |
342 | | from django.conf.urls.defaults import * |
| 364 | from django.conf.urls import patterns, url, include |
343 | 365 | |
344 | 366 | urlpatterns = patterns('', |
345 | 367 | (r'^articles/(\d{4})/$', 'news.views.year_archive'), |
… |
… |
|
354 | 376 | |
355 | 377 | With this in mind, the above example can be written more concisely as:: |
356 | 378 | |
357 | | from django.conf.urls.defaults import * |
| 379 | from django.conf.urls import patterns, url, include |
358 | 380 | |
359 | 381 | urlpatterns = patterns('news.views', |
360 | 382 | (r'^articles/(\d{4})/$', 'year_archive'), |
… |
… |
|
375 | 397 | |
376 | 398 | Old:: |
377 | 399 | |
378 | | from django.conf.urls.defaults import * |
| 400 | from django.conf.urls import patterns, url, include |
379 | 401 | |
380 | 402 | urlpatterns = patterns('', |
381 | 403 | (r'^$', 'django.views.generic.date_based.archive_index'), |
… |
… |
|
385 | 407 | |
386 | 408 | New:: |
387 | 409 | |
388 | | from django.conf.urls.defaults import * |
| 410 | from django.conf.urls import patterns, url, include |
389 | 411 | |
390 | 412 | urlpatterns = patterns('django.views.generic.date_based', |
391 | 413 | (r'^$', 'archive_index'), |
… |
… |
|
405 | 427 | For example, here's the URLconf for the `Django Web site`_ itself. It includes a |
406 | 428 | number of other URLconfs:: |
407 | 429 | |
408 | | from django.conf.urls.defaults import * |
| 430 | from django.conf.urls import patterns, url, include |
409 | 431 | |
410 | 432 | urlpatterns = patterns('', |
411 | 433 | (r'^weblog/', include('django_website.apps.blog.urls.blog')), |
… |
… |
|
423 | 445 | URLconf Python module defining them as the `include`_ argument but by using |
424 | 446 | directly the pattern list as returned by `patterns`_ instead. For example:: |
425 | 447 | |
426 | | from django.conf.urls.defaults import * |
| 448 | from django.conf.urls import patterns, url, include |
427 | 449 | |
428 | 450 | extra_patterns = patterns('', |
429 | 451 | url(r'reports/(?P<id>\d+)/$', 'credit.views.report', name='credit-reports'), |
-
diff --git a/docs/topics/i18n/internationalization.txt b/docs/topics/i18n/internationalization.txt
a
|
b
|
|
812 | 812 | .. function:: i18n_patterns(prefix, pattern_description, ...) |
813 | 813 | |
814 | 814 | This function can be used in your root URLconf as a replacement for the normal |
815 | | :func:`django.conf.urls.defaults.patterns` function. Django will automatically |
| 815 | :func:`django.conf.urls.patterns` function. Django will automatically |
816 | 816 | prepend the current active language code to all url patterns defined within |
817 | 817 | :func:`~django.conf.urls.i18n.i18n_patterns`. Example URL patterns:: |
818 | 818 | |
819 | | from django.conf.urls.defaults import patterns, include, url |
| 819 | from django.conf.urls import patterns, include, url |
820 | 820 | from django.conf.urls.i18n import i18n_patterns |
821 | 821 | |
822 | 822 | urlpatterns = patterns('' |
… |
… |
|
870 | 870 | URL patterns can also be marked translatable using the |
871 | 871 | :func:`~django.utils.translation.ugettext_lazy` function. Example:: |
872 | 872 | |
873 | | from django.conf.urls.defaults import patterns, include, url |
| 873 | from django.conf.urls import patterns, include, url |
874 | 874 | from django.conf.urls.i18n import i18n_patterns |
875 | 875 | from django.utils.translation import ugettext_lazy as _ |
876 | 876 | |
-
diff --git a/tests/modeltests/test_client/urls.py b/tests/modeltests/test_client/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns |
2 | 2 | from django.views.generic import RedirectView |
3 | 3 | import views |
4 | 4 | |
-
diff --git a/tests/regressiontests/admin_views/customadmin.py b/tests/regressiontests/admin_views/customadmin.py
a
|
b
|
|
1 | 1 | """ |
2 | 2 | A second, custom AdminSite -- see tests.CustomAdminSiteTests. |
3 | 3 | """ |
4 | | from django.conf.urls.defaults import patterns |
| 4 | from django.conf.urls import patterns |
5 | 5 | from django.contrib import admin |
6 | 6 | from django.http import HttpResponse |
7 | 7 | |
-
diff --git a/tests/regressiontests/admin_views/urls.py b/tests/regressiontests/admin_views/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, include |
2 | 2 | from django.contrib import admin |
3 | 3 | import views |
4 | 4 | import customadmin |
-
diff --git a/tests/regressiontests/admin_widgets/urls.py b/tests/regressiontests/admin_widgets/urls.py
a
|
b
|
|
1 | | |
2 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, include |
3 | 2 | import widgetadmin |
4 | 3 | |
5 | 4 | urlpatterns = patterns('', |
-
diff --git a/tests/regressiontests/comment_tests/urls.py b/tests/regressiontests/comment_tests/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, url |
2 | 2 | from django.contrib.comments.feeds import LatestCommentFeed |
3 | 3 | |
4 | 4 | feeds = { |
-
diff --git a/tests/regressiontests/comment_tests/urls_admin.py b/tests/regressiontests/comment_tests/urls_admin.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, include |
2 | 2 | from django.contrib import admin |
3 | 3 | from django.contrib.comments.admin import CommentsAdmin |
4 | 4 | from django.contrib.comments.models import Comment |
-
diff --git a/tests/regressiontests/conditional_processing/urls.py b/tests/regressiontests/conditional_processing/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns |
2 | 2 | import views |
3 | 3 | |
4 | 4 | urlpatterns = patterns('', |
-
diff --git a/tests/regressiontests/context_processors/urls.py b/tests/regressiontests/context_processors/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, url |
2 | 2 | |
3 | 3 | import views |
4 | 4 | |
-
diff --git a/tests/regressiontests/file_uploads/urls.py b/tests/regressiontests/file_uploads/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns |
2 | 2 | import views |
3 | 3 | |
4 | 4 | urlpatterns = patterns('', |
-
diff --git a/tests/regressiontests/generic_inline_admin/urls.py b/tests/regressiontests/generic_inline_admin/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, include |
2 | 2 | from django.contrib import admin |
3 | 3 | |
4 | 4 | urlpatterns = patterns('', |
-
diff --git a/tests/regressiontests/generic_views/urls.py b/tests/regressiontests/generic_views/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, url |
2 | 2 | from django.views.generic import TemplateView |
3 | 3 | from django.views.decorators.cache import cache_page |
4 | 4 | |
-
diff --git a/tests/regressiontests/i18n/patterns/urls/default.py b/tests/regressiontests/i18n/patterns/urls/default.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import patterns, include, url |
| 1 | from django.conf.urls import patterns, include, url |
2 | 2 | from django.conf.urls.i18n import i18n_patterns |
3 | 3 | from django.utils.translation import ugettext_lazy as _ |
4 | 4 | from django.views.generic import TemplateView |
-
diff --git a/tests/regressiontests/i18n/patterns/urls/disabled.py b/tests/regressiontests/i18n/patterns/urls/disabled.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import url |
| 1 | from django.conf.urls import url |
2 | 2 | from django.conf.urls.i18n import i18n_patterns |
3 | 3 | from django.views.generic import TemplateView |
4 | 4 | |
-
diff --git a/tests/regressiontests/i18n/patterns/urls/namespace.py b/tests/regressiontests/i18n/patterns/urls/namespace.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import patterns, url |
| 1 | from django.conf.urls import patterns, url |
2 | 2 | from django.utils.translation import ugettext_lazy as _ |
3 | 3 | from django.views.generic import TemplateView |
4 | 4 | |
-
diff --git a/tests/regressiontests/i18n/patterns/urls/wrong.py b/tests/regressiontests/i18n/patterns/urls/wrong.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import include, url |
| 1 | from django.conf.urls import include, url |
2 | 2 | from django.conf.urls.i18n import i18n_patterns |
3 | 3 | from django.utils.translation import ugettext_lazy as _ |
4 | 4 | |
-
diff --git a/tests/regressiontests/i18n/patterns/urls/wrong_namespace.py b/tests/regressiontests/i18n/patterns/urls/wrong_namespace.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import url |
| 1 | from django.conf.urls import url |
2 | 2 | from django.conf.urls.i18n import i18n_patterns |
3 | 3 | from django.utils.translation import ugettext_lazy as _ |
4 | 4 | from django.views.generic import TemplateView |
-
diff --git a/tests/regressiontests/middleware/cond_get_urls.py b/tests/regressiontests/middleware/cond_get_urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import patterns |
| 1 | from django.conf.urls import patterns |
2 | 2 | from django.http import HttpResponse |
3 | 3 | |
4 | 4 | urlpatterns = patterns('', |
-
diff --git a/tests/regressiontests/middleware/extra_urls.py b/tests/regressiontests/middleware/extra_urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import patterns |
| 1 | from django.conf.urls import patterns |
2 | 2 | |
3 | 3 | urlpatterns = patterns('', |
4 | 4 | (r'^middleware/customurlconf/noslash$', 'view'), |
-
diff --git a/tests/regressiontests/middleware/urls.py b/tests/regressiontests/middleware/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import patterns |
| 1 | from django.conf.urls import patterns |
2 | 2 | |
3 | 3 | urlpatterns = patterns('', |
4 | 4 | (r'^noslash$', 'view'), |
-
diff --git a/tests/regressiontests/middleware_exceptions/urls.py b/tests/regressiontests/middleware_exceptions/urls.py
a
|
b
|
|
1 | 1 | # coding: utf-8 |
2 | | from django.conf.urls.defaults import * |
| 2 | from django.conf.urls import patterns |
3 | 3 | |
4 | 4 | import views |
5 | 5 | |
-
diff --git a/tests/regressiontests/model_permalink/urls.py b/tests/regressiontests/model_permalink/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, url |
2 | 2 | |
3 | 3 | urlpatterns = patterns('', |
4 | 4 | url(r'^guitarists/(\w{1,50})/$', 'unimplemented_view_placeholder', name='guitarist_detail'), |
-
diff --git a/tests/regressiontests/special_headers/urls.py b/tests/regressiontests/special_headers/urls.py
a
|
b
|
|
1 | 1 | # coding: utf-8 |
2 | | from django.conf.urls.defaults import * |
| 2 | from django.conf.urls import patterns |
3 | 3 | from django.views.generic.list_detail import object_detail |
4 | 4 | from models import Article |
5 | 5 | import views |
-
diff --git a/tests/regressiontests/staticfiles_tests/urls/default.py b/tests/regressiontests/staticfiles_tests/urls/default.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import patterns, url |
| 1 | from django.conf.urls import patterns, url |
2 | 2 | |
3 | 3 | urlpatterns = patterns('', |
4 | 4 | url(r'^static/(?P<path>.*)$', 'django.contrib.staticfiles.views.serve'), |
-
diff --git a/tests/regressiontests/syndication/urls.py b/tests/regressiontests/syndication/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns |
2 | 2 | |
3 | 3 | import feeds |
4 | 4 | |
-
diff --git a/tests/regressiontests/templates/alternate_urls.py b/tests/regressiontests/templates/alternate_urls.py
a
|
b
|
|
1 | 1 | # coding: utf-8 |
2 | | from django.conf.urls.defaults import * |
| 2 | from django.conf.urls import patterns, url |
3 | 3 | |
4 | 4 | from regressiontests.templates import views |
5 | 5 | |
-
diff --git a/tests/regressiontests/templates/urls.py b/tests/regressiontests/templates/urls.py
a
|
b
|
|
1 | 1 | # coding: utf-8 |
2 | | from django.conf.urls.defaults import * |
| 2 | from django.conf.urls import patterns, url |
3 | 3 | from regressiontests.templates import views |
4 | 4 | |
5 | 5 | urlpatterns = patterns('', |
-
diff --git a/tests/regressiontests/test_client_regress/urls.py b/tests/regressiontests/test_client_regress/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, url |
2 | 2 | from django.views.generic import RedirectView |
3 | 3 | import views |
4 | 4 | |
-
diff --git a/tests/regressiontests/test_utils/urls.py b/tests/regressiontests/test_utils/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import patterns |
| 1 | from django.conf.urls import patterns |
2 | 2 | |
3 | 3 | import views |
4 | 4 | |
-
diff --git a/tests/regressiontests/urlpatterns_reverse/erroneous_urls.py b/tests/regressiontests/urlpatterns_reverse/erroneous_urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import patterns, url |
| 1 | from django.conf.urls import patterns, url |
2 | 2 | |
3 | 3 | urlpatterns = patterns('', |
4 | 4 | # View has erroneous import |
-
diff --git a/tests/regressiontests/urlpatterns_reverse/extra_urls.py b/tests/regressiontests/urlpatterns_reverse/extra_urls.py
a
|
b
|
|
2 | 2 | Some extra URL patterns that are included at the top level. |
3 | 3 | """ |
4 | 4 | |
5 | | from django.conf.urls.defaults import * |
| 5 | from django.conf.urls import patterns, url, include |
6 | 6 | from views import empty_view |
7 | 7 | |
8 | 8 | urlpatterns = patterns('', |
-
diff --git a/tests/regressiontests/urlpatterns_reverse/included_named_urls.py b/tests/regressiontests/urlpatterns_reverse/included_named_urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, url, include |
2 | 2 | from views import empty_view |
3 | 3 | |
4 | 4 | urlpatterns = patterns('', |
-
diff --git a/tests/regressiontests/urlpatterns_reverse/included_named_urls2.py b/tests/regressiontests/urlpatterns_reverse/included_named_urls2.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, url |
2 | 2 | from views import empty_view |
3 | 3 | |
4 | 4 | urlpatterns = patterns('', |
-
diff --git a/tests/regressiontests/urlpatterns_reverse/included_namespace_urls.py b/tests/regressiontests/urlpatterns_reverse/included_namespace_urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, url, include |
2 | 2 | from namespace_urls import URLObject |
3 | 3 | from views import view_class_instance |
4 | 4 | |
-
diff --git a/tests/regressiontests/urlpatterns_reverse/included_urls.py b/tests/regressiontests/urlpatterns_reverse/included_urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, url |
2 | 2 | from views import empty_view |
3 | 3 | |
4 | 4 | urlpatterns = patterns('', |
-
diff --git a/tests/regressiontests/urlpatterns_reverse/included_urls2.py b/tests/regressiontests/urlpatterns_reverse/included_urls2.py
a
|
b
|
|
5 | 5 | argument list. |
6 | 6 | """ |
7 | 7 | |
8 | | from django.conf.urls.defaults import * |
| 8 | from django.conf.urls import patterns, url |
9 | 9 | from views import empty_view |
10 | 10 | |
11 | 11 | urlpatterns = patterns('', |
-
diff --git a/tests/regressiontests/urlpatterns_reverse/named_urls.py b/tests/regressiontests/urlpatterns_reverse/named_urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, url, include |
2 | 2 | from views import empty_view |
3 | 3 | |
4 | 4 | urlpatterns = patterns('', |
-
diff --git a/tests/regressiontests/urlpatterns_reverse/namespace_urls.py b/tests/regressiontests/urlpatterns_reverse/namespace_urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, url, include |
2 | 2 | from views import view_class_instance |
3 | 3 | |
4 | 4 | class URLObject(object): |
-
diff --git a/tests/regressiontests/urlpatterns_reverse/no_urls.py b/tests/regressiontests/urlpatterns_reverse/no_urls.py
a
|
b
|
|
1 | | #from django.conf.urls.defaults import * |
| 1 | #from django.conf.urls import patterns, url, include |
2 | 2 | |
-
diff --git a/tests/regressiontests/urlpatterns_reverse/reverse_lazy_urls.py b/tests/regressiontests/urlpatterns_reverse/reverse_lazy_urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, url |
2 | 2 | |
3 | 3 | from views import empty_view, LazyRedirectView, login_required_view |
4 | 4 | |
-
diff --git a/tests/regressiontests/urlpatterns_reverse/urlconf_inner.py b/tests/regressiontests/urlpatterns_reverse/urlconf_inner.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, url |
2 | 2 | from django.template import Template, Context |
3 | 3 | from django.http import HttpResponse |
4 | 4 | |
-
diff --git a/tests/regressiontests/urlpatterns_reverse/urlconf_outer.py b/tests/regressiontests/urlpatterns_reverse/urlconf_outer.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, url, include |
2 | 2 | |
3 | 3 | import urlconf_inner |
4 | 4 | |
-
diff --git a/tests/regressiontests/urlpatterns_reverse/urls.py b/tests/regressiontests/urlpatterns_reverse/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, url, include |
2 | 2 | from views import empty_view, absolute_kwargs_view |
3 | 3 | |
4 | 4 | other_patterns = patterns('', |
-
diff --git a/tests/regressiontests/urlpatterns_reverse/urls_error_handlers.py b/tests/regressiontests/urlpatterns_reverse/urls_error_handlers.py
a
|
b
|
|
1 | 1 | # Used by the ErrorHandlerResolutionTests test case. |
2 | 2 | |
3 | | from django.conf.urls.defaults import patterns |
| 3 | from django.conf.urls import patterns |
4 | 4 | |
5 | 5 | urlpatterns = patterns('') |
6 | 6 | |
-
diff --git a/tests/regressiontests/urlpatterns_reverse/urls_error_handlers_callables.py b/tests/regressiontests/urlpatterns_reverse/urls_error_handlers_callables.py
a
|
b
|
|
1 | 1 | # Used by the ErrorHandlerResolutionTests test case. |
2 | 2 | |
3 | | from django.conf.urls.defaults import patterns |
| 3 | from django.conf.urls import patterns |
4 | 4 | from views import empty_view |
5 | 5 | |
6 | 6 | urlpatterns = patterns('') |
-
diff --git a/tests/regressiontests/urlpatterns_reverse/urls_without_full_import.py b/tests/regressiontests/urlpatterns_reverse/urls_without_full_import.py
a
|
b
|
|
1 | 1 | # A URLs file that doesn't use the default |
2 | | # from django.conf.urls.defaults import * |
| 2 | # from django.conf.urls import * |
3 | 3 | # import pattern. |
4 | | from django.conf.urls.defaults import patterns, url |
| 4 | from django.conf.urls import patterns, url |
5 | 5 | from views import empty_view, bad_view |
6 | 6 | |
7 | 7 | urlpatterns = patterns('', |
-
diff --git a/tests/regressiontests/views/generic_urls.py b/tests/regressiontests/views/generic_urls.py
a
|
b
|
|
1 | 1 | # -*- coding:utf-8 -*- |
2 | | from django.conf.urls.defaults import patterns, url |
| 2 | from django.conf.urls import patterns, url |
3 | 3 | |
4 | 4 | from models import * |
5 | 5 | |
-
diff --git a/tests/regressiontests/views/urls.py b/tests/regressiontests/views/urls.py
a
|
b
|
|
1 | 1 | # coding: utf-8 |
2 | 2 | from os import path |
3 | 3 | |
4 | | from django.conf.urls.defaults import * |
| 4 | from django.conf.urls import patterns, url, include |
5 | 5 | |
6 | 6 | import views |
7 | 7 | |
-
diff --git a/tests/urls.py b/tests/urls.py
a
|
b
|
|
1 | | from django.conf.urls.defaults import * |
| 1 | from django.conf.urls import patterns, include |
2 | 2 | |
3 | 3 | |
4 | 4 | urlpatterns = patterns('', |