-
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 (handler403, handler404, handler500, |
| 2 | include, patterns, url) |
-
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
|
|
320 | 320 | super(ModelAdmin, self).__init__() |
321 | 321 | |
322 | 322 | def get_urls(self): |
323 | | from django.conf.urls.defaults import patterns, url |
| 323 | from django.conf.urls import patterns, url |
324 | 324 | |
325 | 325 | def wrap(view): |
326 | 326 | 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() |
… |
… |
|
367 | 367 | You normally won't have to bother with writing 404 views. By default, URLconfs |
368 | 368 | have the following line up top:: |
369 | 369 | |
370 | | from django.conf.urls.defaults import patterns, include, url |
| 370 | from django.conf.urls import patterns, include, url |
371 | 371 | |
372 | 372 | That takes care of setting ``handler404`` in the current module. As you can see |
373 | 373 | in ``django/conf/urls/defaults.py``, ``handler404`` is set to |
… |
… |
|
443 | 443 | |
444 | 444 | Because this is a common case, the URLconf framework provides a shortcut for |
445 | 445 | common prefixes. You can factor out the common prefixes and add them as the |
446 | | first argument to :func:`~django.conf.urls.defaults.patterns`, like so:: |
| 446 | first argument to :func:`~django.conf.urls.patterns`, like so:: |
447 | 447 | |
448 | 448 | urlpatterns = patterns('polls.views', |
449 | 449 | (r'^polls/$', 'index'), |
… |
… |
|
457 | 457 | |
458 | 458 | Since you generally don't want the prefix for one app to be applied to every |
459 | 459 | callback in your URLconf, you can concatenate multiple |
460 | | :func:`~django.conf.urls.defaults.patterns`. Your full ``mysite/urls.py`` might |
| 460 | :func:`~django.conf.urls.patterns`. Your full ``mysite/urls.py`` might |
461 | 461 | now look like this:: |
462 | 462 | |
463 | | from django.conf.urls.defaults import patterns, include, url |
| 463 | from django.conf.urls import patterns, include, url |
464 | 464 | |
465 | 465 | from django.contrib import admin |
466 | 466 | admin.autodiscover() |
467 | | |
| 467 | |
468 | 468 | urlpatterns = patterns('polls.views', |
469 | 469 | (r'^polls/$', 'index'), |
470 | 470 | (r'^polls/(?P<poll_id>\d+)/$', 'detail'), |
471 | 471 | (r'^polls/(?P<poll_id>\d+)/results/$', 'results'), |
472 | 472 | (r'^polls/(?P<poll_id>\d+)/vote/$', 'vote'), |
473 | 473 | ) |
474 | | |
| 474 | |
475 | 475 | urlpatterns += patterns('', |
476 | 476 | url(r'^admin/', include(admin.site.urls)), |
477 | 477 | ) |
… |
… |
|
494 | 494 | |
495 | 495 | Copy the file ``mysite/urls.py`` to ``polls/urls.py``. Then, change |
496 | 496 | ``mysite/urls.py`` to remove the poll-specific URLs and insert an |
497 | | :func:`~django.conf.urls.defaults.include`, leaving you with:: |
| 497 | :func:`~django.conf.urls.include`, leaving you with:: |
498 | 498 | |
499 | 499 | # This also imports the include function |
500 | | from django.conf.urls.defaults import patterns, include, url |
501 | | |
| 500 | from django.conf.urls import patterns, include, url |
| 501 | |
502 | 502 | from django.contrib import admin |
503 | 503 | admin.autodiscover() |
504 | | |
| 504 | |
505 | 505 | urlpatterns = patterns('', |
506 | 506 | (r'^polls/', include('polls.urls')), |
507 | 507 | url(r'^admin/', include(admin.site.urls)), |
508 | 508 | ) |
509 | 509 | |
510 | | :func:`~django.conf.urls.defaults.include` simply references another URLconf. |
| 510 | :func:`~django.conf.urls.include` simply references another URLconf. |
511 | 511 | Note that the regular expression doesn't have a ``$`` (end-of-string match |
512 | 512 | character) but has the trailing slash. Whenever Django encounters |
513 | | :func:`~django.conf.urls.defaults.include`, it chops off whatever part of the |
| 513 | :func:`~django.conf.urls.include`, it chops off whatever part of the |
514 | 514 | URL matched up to that point and sends the remaining string to the included |
515 | 515 | URLconf for further processing. |
516 | 516 | |
… |
… |
|
527 | 527 | lines registering the admin site. Your ``polls/urls.py`` file should now look like |
528 | 528 | this:: |
529 | 529 | |
530 | | from django.conf.urls.defaults import patterns, include, url |
| 530 | from django.conf.urls import patterns, include, url |
531 | 531 | |
532 | 532 | urlpatterns = patterns('polls.views', |
533 | 533 | (r'^$', 'index'), |
… |
… |
|
536 | 536 | (r'^(?P<poll_id>\d+)/vote/$', 'vote'), |
537 | 537 | ) |
538 | 538 | |
539 | | The idea behind :func:`~django.conf.urls.defaults.include` and URLconf |
| 539 | The idea behind :func:`~django.conf.urls.include` and URLconf |
540 | 540 | decoupling is to make it easy to plug-and-play URLs. Now that polls are in their |
541 | 541 | own URLconf, they can be placed under "/polls/", or under "/fun_polls/", or |
542 | 542 | 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
|
|
1831 | 1831 | ``django.contrib.admin.site`` at the URL ``/admin/`` :: |
1832 | 1832 | |
1833 | 1833 | # urls.py |
1834 | | from django.conf.urls.defaults import * |
| 1834 | from django.conf.urls import patterns, url, include |
1835 | 1835 | from django.contrib import admin |
1836 | 1836 | |
1837 | 1837 | admin.autodiscover() |
… |
… |
|
1847 | 1847 | ``myproject.admin.admin_site`` at the URL ``/myadmin/`` :: |
1848 | 1848 | |
1849 | 1849 | # urls.py |
1850 | | from django.conf.urls.defaults import * |
| 1850 | from django.conf.urls import patterns, url, include |
1851 | 1851 | from myproject.admin import admin_site |
1852 | 1852 | |
1853 | 1853 | urlpatterns = patterns('', |
… |
… |
|
1871 | 1871 | respectively:: |
1872 | 1872 | |
1873 | 1873 | # urls.py |
1874 | | from django.conf.urls.defaults import * |
| 1874 | from django.conf.urls import patterns, url, include |
1875 | 1875 | from myproject.admin import basic_site, advanced_site |
1876 | 1876 | |
1877 | 1877 | 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
|
|
697 | 697 | Next, edit your ``urls.py`` in the ``geodjango`` project folder to look |
698 | 698 | as follows:: |
699 | 699 | |
700 | | from django.conf.urls.defaults import * |
| 700 | from django.conf.urls import patterns, url, include |
701 | 701 | from django.contrib.gis import admin |
702 | 702 | |
703 | 703 | 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
|
|
524 | 524 | rather than the view function. A named URL pattern is defined by replacing the |
525 | 525 | pattern tuple by a call to the ``url`` function):: |
526 | 526 | |
527 | | from django.conf.urls.defaults import * |
| 527 | from django.conf.urls import patterns, url, include |
528 | 528 | |
529 | 529 | url(r'^people/(\d+)/$', 'blog_views.generic_detail', name='people_view'), |
530 | 530 | |
-
diff --git a/docs/releases/1.4.txt b/docs/releases/1.4.txt
a
|
b
|
|
290 | 290 | MySQL with the InnoDB database engine. |
291 | 291 | |
292 | 292 | * A new 403 response handler has been added as |
293 | | ``'django.views.defaults.permission_denied'``. See the documentation |
294 | | about :ref:`the 403 (HTTP Forbidden) view<http_forbidden_view>` for more |
295 | | information. |
| 293 | ``'django.views.defaults.permission_denied'``. You can set your own handler by |
| 294 | setting the value of :data:`django.conf.urls.handler403`. See the |
| 295 | documentation about :ref:`the 403 (HTTP Forbidden) view<http_forbidden_view>` |
| 296 | for more information. |
296 | 297 | |
297 | 298 | * The :ttag:`trans` template tag now takes an optional ``as`` argument to |
298 | 299 | be able to retrieve a translation string without displaying it but setting |
… |
… |
|
590 | 591 | |
591 | 592 | The existence of any ``'filters'`` key under the ``'mail_admins'`` handler will |
592 | 593 | disable this backward-compatibility shim and deprecation warning. |
| 594 | |
| 595 | ``django.conf.urls.defaults`` |
| 596 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 597 | |
| 598 | Until Django 1.3 the functions :func:`~django.conf.urls.include`, |
| 599 | :func:`~django.conf.urls.patterns` and :func:`~django.conf.urls.url` plus |
| 600 | :data:`~django.conf.urls.handler404`, :data:`~django.conf.urls.handler500` |
| 601 | were located in a ``django.conf.urls.defaults`` module. |
| 602 | |
| 603 | 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. |
… |
… |
|
69 | 69 | |
70 | 70 | Here's a sample URLconf:: |
71 | 71 | |
72 | | from django.conf.urls.defaults import * |
| 72 | from django.conf.urls import patterns, url, include |
73 | 73 | |
74 | 74 | urlpatterns = patterns('', |
75 | 75 | (r'^articles/2003/$', 'news.views.special_case_2003'), |
… |
… |
|
80 | 80 | |
81 | 81 | Notes: |
82 | 82 | |
83 | | * ``from django.conf.urls.defaults import *`` makes the ``patterns()`` |
84 | | function available. |
85 | | |
86 | 83 | * To capture a value from the URL, just put parenthesis around it. |
87 | 84 | |
88 | 85 | * There's no need to add a leading slash, because every URL has that. For |
… |
… |
|
184 | 181 | ================================== |
185 | 182 | |
186 | 183 | ``urlpatterns`` should be a Python list, in the format returned by the function |
187 | | :func:`django.conf.urls.defaults.patterns`. Always use ``patterns()`` to create |
| 184 | :func:`django.conf.urls.patterns`. Always use ``patterns()`` to create |
188 | 185 | the ``urlpatterns`` variable. |
189 | 186 | |
190 | | Convention is to use ``from django.conf.urls.defaults import *`` at the top of |
191 | | your URLconf. This gives your module access to these objects: |
| 187 | ``django.conf.urls`` also defines some other functions you'll want to use: |
192 | 188 | |
193 | | .. module:: django.conf.urls.defaults |
| 189 | .. module:: django.conf.urls |
| 190 | |
| 191 | .. versionchanged:: 1.4 |
| 192 | Starting with Django 1.4 `functions `patterns``, ``url``, ``include`` plus |
| 193 | the ``handler*`` symbols described below are now available in the |
| 194 | ``django.conf.urls`` module. |
| 195 | |
| 196 | Until Django 1.3 they were located in ``django.conf.urls.defaults``. For |
| 197 | the time being you still can import them from there. |
194 | 198 | |
195 | 199 | patterns |
196 | 200 | -------- |
… |
… |
|
281 | 285 | See the documentation on :ref:`customizing error views |
282 | 286 | <customizing-error-views>` for more details. |
283 | 287 | |
| 288 | handler403 |
| 289 | ---------- |
| 290 | |
| 291 | .. data:: handler403 |
| 292 | |
| 293 | A callable, or a string representing the full Python import path to the view |
| 294 | that should be called if the user has no the permissions required to access |
| 295 | a resource. |
| 296 | |
| 297 | By default, this is ``'django.views.defaults.permission_denied'``. That default |
| 298 | value should suffice. |
| 299 | |
| 300 | See the documentation about :ref:`the 403 (HTTP Forbidden) view |
| 301 | <http_forbidden_view>` for more information. |
| 302 | |
| 303 | .. versionadded:: 1.4 |
| 304 | ``handler403`` is new in Django 1.4. |
| 305 | |
284 | 306 | handler404 |
285 | 307 | ---------- |
286 | 308 | |
… |
… |
|
355 | 377 | |
356 | 378 | Here's the example URLconf from the :doc:`Django overview </intro/overview>`:: |
357 | 379 | |
358 | | from django.conf.urls.defaults import * |
| 380 | from django.conf.urls import patterns, url, include |
359 | 381 | |
360 | 382 | urlpatterns = patterns('', |
361 | 383 | (r'^articles/(\d{4})/$', 'news.views.year_archive'), |
… |
… |
|
370 | 392 | |
371 | 393 | With this in mind, the above example can be written more concisely as:: |
372 | 394 | |
373 | | from django.conf.urls.defaults import * |
| 395 | from django.conf.urls import patterns, url, include |
374 | 396 | |
375 | 397 | urlpatterns = patterns('news.views', |
376 | 398 | (r'^articles/(\d{4})/$', 'year_archive'), |
… |
… |
|
391 | 413 | |
392 | 414 | Old:: |
393 | 415 | |
394 | | from django.conf.urls.defaults import * |
| 416 | from django.conf.urls import patterns, url, include |
395 | 417 | |
396 | 418 | urlpatterns = patterns('', |
397 | 419 | (r'^$', 'django.views.generic.date_based.archive_index'), |
… |
… |
|
401 | 423 | |
402 | 424 | New:: |
403 | 425 | |
404 | | from django.conf.urls.defaults import * |
| 426 | from django.conf.urls import patterns, url, include |
405 | 427 | |
406 | 428 | urlpatterns = patterns('django.views.generic.date_based', |
407 | 429 | (r'^$', 'archive_index'), |
… |
… |
|
421 | 443 | For example, here's the URLconf for the `Django Web site`_ itself. It includes a |
422 | 444 | number of other URLconfs:: |
423 | 445 | |
424 | | from django.conf.urls.defaults import * |
| 446 | from django.conf.urls import patterns, url, include |
425 | 447 | |
426 | 448 | urlpatterns = patterns('', |
427 | 449 | (r'^weblog/', include('django_website.apps.blog.urls.blog')), |
… |
… |
|
439 | 461 | URLconf Python module defining them as the `include`_ argument but by using |
440 | 462 | directly the pattern list as returned by `patterns`_ instead. For example:: |
441 | 463 | |
442 | | from django.conf.urls.defaults import * |
| 464 | from django.conf.urls import patterns, url, include |
443 | 465 | |
444 | 466 | extra_patterns = patterns('', |
445 | 467 | 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
|
|
819 | 819 | .. function:: i18n_patterns(prefix, pattern_description, ...) |
820 | 820 | |
821 | 821 | This function can be used in your root URLconf as a replacement for the normal |
822 | | :func:`django.conf.urls.defaults.patterns` function. Django will automatically |
| 822 | :func:`django.conf.urls.patterns` function. Django will automatically |
823 | 823 | prepend the current active language code to all url patterns defined within |
824 | 824 | :func:`~django.conf.urls.i18n.i18n_patterns`. Example URL patterns:: |
825 | 825 | |
826 | | from django.conf.urls.defaults import patterns, include, url |
| 826 | from django.conf.urls import patterns, include, url |
827 | 827 | from django.conf.urls.i18n import i18n_patterns |
828 | 828 | |
829 | 829 | urlpatterns = patterns('' |
… |
… |
|
877 | 877 | URL patterns can also be marked translatable using the |
878 | 878 | :func:`~django.utils.translation.ugettext_lazy` function. Example:: |
879 | 879 | |
880 | | from django.conf.urls.defaults import patterns, include, url |
| 880 | from django.conf.urls import patterns, include, url |
881 | 881 | from django.conf.urls.i18n import i18n_patterns |
882 | 882 | from django.utils.translation import ugettext_lazy as _ |
883 | 883 | |
-
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('', |