mirror of
https://github.com/django/django.git
synced 2025-08-04 02:48:35 +00:00
Fixed #14675 -- Completed removal of from django.conf.urls.default import *
usage.
This applies to both our own [test] code and documentation examples. Also: * Moved the functions and handlers from `django.conf.urls.defaults` up to `django.conf.urls` deprecating the former module. * Added documentation for `handler403`. * Tweaked the URLs topic document a bit. Thanks to pupeno and cdestigter for their great work contributing patches. git-svn-id: http://code.djangoproject.com/svn/django/trunk@16818 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
fd90453462
commit
26b8122087
88 changed files with 243 additions and 198 deletions
|
@ -1831,7 +1831,7 @@ In this example, we register the default ``AdminSite`` instance
|
|||
``django.contrib.admin.site`` at the URL ``/admin/`` ::
|
||||
|
||||
# urls.py
|
||||
from django.conf.urls.defaults import *
|
||||
from django.conf.urls import patterns, url, include
|
||||
from django.contrib import admin
|
||||
|
||||
admin.autodiscover()
|
||||
|
@ -1847,7 +1847,7 @@ In this example, we register the ``AdminSite`` instance
|
|||
``myproject.admin.admin_site`` at the URL ``/myadmin/`` ::
|
||||
|
||||
# urls.py
|
||||
from django.conf.urls.defaults import *
|
||||
from django.conf.urls import patterns, url, include
|
||||
from myproject.admin import admin_site
|
||||
|
||||
urlpatterns = patterns('',
|
||||
|
@ -1871,7 +1871,7 @@ separate versions of the admin site -- using the ``AdminSite`` instances
|
|||
respectively::
|
||||
|
||||
# urls.py
|
||||
from django.conf.urls.defaults import *
|
||||
from django.conf.urls import patterns, url, include
|
||||
from myproject.admin import basic_site, advanced_site
|
||||
|
||||
urlpatterns = patterns('',
|
||||
|
|
|
@ -143,7 +143,7 @@ enable it in your project's ``urls.py``:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from django.conf.urls.defaults import *
|
||||
from django.conf.urls import patterns, url, include
|
||||
from django.contrib.comments.feeds import LatestCommentFeed
|
||||
|
||||
urlpatterns = patterns('',
|
||||
|
@ -161,7 +161,7 @@ syndication feed view:
|
|||
|
||||
.. code-block:: python
|
||||
|
||||
from django.conf.urls.defaults import *
|
||||
from django.conf.urls import patterns
|
||||
from django.contrib.comments.feeds import LatestCommentFeed
|
||||
|
||||
feeds = {
|
||||
|
|
|
@ -217,7 +217,7 @@ deploy the new :class:`WizardView` object a URL in the ``urls.py``. The
|
|||
wizard's :meth:`as_view` method takes a list of your
|
||||
:class:`~django.forms.Form` classes as an argument during instantiation::
|
||||
|
||||
from django.conf.urls.defaults import patterns
|
||||
from django.conf.urls import patterns
|
||||
|
||||
from myapp.forms import ContactForm1, ContactForm2
|
||||
from myapp.views import ContactWizard
|
||||
|
@ -525,7 +525,7 @@ We define our wizard in a ``views.py``::
|
|||
|
||||
We need to add the ``ContactWizard`` to our ``urls.py`` file::
|
||||
|
||||
from django.conf.urls.defaults import pattern
|
||||
from django.conf.urls import pattern
|
||||
|
||||
from myapp.forms import ContactForm1, ContactForm2
|
||||
from myapp.views import ContactWizard, show_message_form_condition
|
||||
|
@ -572,7 +572,7 @@ Additionally you have to pass two more arguments to the
|
|||
|
||||
Example code for the changed ``urls.py`` file::
|
||||
|
||||
from django.conf.urls.defaults import url, patterns
|
||||
from django.conf.urls import url, patterns
|
||||
|
||||
from myapp.forms import ContactForm1, ContactForm2
|
||||
from myapp.views import ContactWizard
|
||||
|
|
|
@ -697,7 +697,7 @@ Let's dive in again -- create a file called ``admin.py`` inside the
|
|||
Next, edit your ``urls.py`` in the ``geodjango`` project folder to look
|
||||
as follows::
|
||||
|
||||
from django.conf.urls.defaults import *
|
||||
from django.conf.urls import patterns, url, include
|
||||
from django.contrib.gis import admin
|
||||
|
||||
admin.autodiscover()
|
||||
|
|
|
@ -241,7 +241,7 @@ Example
|
|||
|
||||
Here's an example of a :doc:`URLconf </topics/http/urls>` using both::
|
||||
|
||||
from django.conf.urls.defaults import *
|
||||
from django.conf.urls import patterns, url, include
|
||||
from django.contrib.sitemaps import FlatPageSitemap, GenericSitemap
|
||||
from blog.models import Entry
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ latest five news items::
|
|||
To connect a URL to this feed, put an instance of the Feed object in
|
||||
your :doc:`URLconf </topics/http/urls>`. For example::
|
||||
|
||||
from django.conf.urls.defaults import *
|
||||
from django.conf.urls import patterns, url, include
|
||||
from myproject.feeds import LatestEntriesFeed
|
||||
|
||||
urlpatterns = patterns('',
|
||||
|
@ -327,7 +327,7 @@ Here's a full example::
|
|||
|
||||
And the accompanying URLconf::
|
||||
|
||||
from django.conf.urls.defaults import *
|
||||
from django.conf.urls import patterns, url, include
|
||||
from myproject.feeds import RssSiteNewsFeed, AtomSiteNewsFeed
|
||||
|
||||
urlpatterns = patterns('',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue