From e5376999fa9c75efe42ba963a00e2552f66cab9c Mon Sep 17 00:00:00 2001 From: Collin Anderson Date: Wed, 13 Aug 2014 14:09:31 -0400 Subject: [PATCH] Refs #23276 -- Added missing url() in some places. --- docs/ref/class-based-views/mixins-multiple-object.txt | 2 +- docs/ref/contrib/admin/index.txt | 4 ++-- docs/ref/contrib/formtools/form-preview.txt | 2 +- docs/ref/contrib/syndication.txt | 2 +- docs/topics/auth/default.txt | 8 +++++--- docs/topics/i18n/translation.txt | 2 +- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/ref/class-based-views/mixins-multiple-object.txt b/docs/ref/class-based-views/mixins-multiple-object.txt index b3de1a7a94..c5acff6208 100644 --- a/docs/ref/class-based-views/mixins-multiple-object.txt +++ b/docs/ref/class-based-views/mixins-multiple-object.txt @@ -15,7 +15,7 @@ MultipleObjectMixin * Use the ``page`` parameter in the URLconf. For example, this is what your URLconf might look like:: - (r'^objects/page(?P[0-9]+)/$', PaginatedView.as_view()) + url(r'^objects/page(?P[0-9]+)/$', PaginatedView.as_view()), * Pass the page number via the ``page`` query-string parameter. For example, a URL would look like this:: diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index 26c43b9743..4c0543cd1f 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -1456,7 +1456,7 @@ templates used by the :class:`ModelAdmin` views: Notice the wrapped view in the fifth line above:: - (r'^my_view/$', self.admin_site.admin_view(self.my_view)) + url(r'^my_view/$', self.admin_site.admin_view(self.my_view)) This wrapping will protect ``self.my_view`` from unauthorized access and will apply the ``django.views.decorators.cache.never_cache`` decorator to @@ -1466,7 +1466,7 @@ templates used by the :class:`ModelAdmin` views: performed, you can pass a ``cacheable=True`` argument to ``AdminSite.admin_view()``:: - (r'^my_view/$', self.admin_site.admin_view(self.my_view, cacheable=True)) + url(r'^my_view/$', self.admin_site.admin_view(self.my_view, cacheable=True)) .. method:: ModelAdmin.get_form(request, obj=None, **kwargs) diff --git a/docs/ref/contrib/formtools/form-preview.txt b/docs/ref/contrib/formtools/form-preview.txt index 6a30fe9d9f..2c8d44459f 100644 --- a/docs/ref/contrib/formtools/form-preview.txt +++ b/docs/ref/contrib/formtools/form-preview.txt @@ -77,7 +77,7 @@ How to use ``FormPreview`` ...and add the following line to the appropriate model in your URLconf:: - (r'^post/$', SomeModelFormPreview(SomeModelForm)), + url(r'^post/$', SomeModelFormPreview(SomeModelForm)), where ``SomeModelForm`` is a Form or ModelForm class for the model. diff --git a/docs/ref/contrib/syndication.txt b/docs/ref/contrib/syndication.txt index 3310edd343..7e31eb07e9 100644 --- a/docs/ref/contrib/syndication.txt +++ b/docs/ref/contrib/syndication.txt @@ -217,7 +217,7 @@ The police beat feeds could be accessible via URLs like this: These can be matched with a :doc:`URLconf ` line such as:: - (r'^beats/(?P[0-9]+)/rss/$', BeatFeed()), + url(r'^beats/(?P[0-9]+)/rss/$', BeatFeed()), Like a view, the arguments in the URL are passed to the ``get_object()`` method along with the request object. diff --git a/docs/topics/auth/default.txt b/docs/topics/auth/default.txt index 8fbb8611f8..25b0f390d8 100644 --- a/docs/topics/auth/default.txt +++ b/docs/topics/auth/default.txt @@ -476,9 +476,11 @@ The login_required decorator Note that if you don't specify the ``login_url`` parameter, you'll need to ensure that the :setting:`settings.LOGIN_URL ` and your login view are properly associated. For example, using the defaults, add the - following line to your URLconf:: + following lines to your URLconf:: - (r'^accounts/login/$', 'django.contrib.auth.views.login'), + from django.contrib.auth import views as auth_views + + url(r'^accounts/login/$', auth_views.login), The :setting:`settings.LOGIN_URL ` also accepts view function names and :ref:`named URL patterns `. This allows you @@ -752,7 +754,7 @@ patterns. the view in your URLconf. For example, this URLconf line would use :file:`myapp/login.html` instead:: - (r'^accounts/login/$', 'django.contrib.auth.views.login', {'template_name': 'myapp/login.html'}), + url(r'^accounts/login/$', auth_views.login, {'template_name': 'myapp/login.html'}), You can also specify the name of the ``GET`` field which contains the URL to redirect to after login by passing ``redirect_field_name`` to the view. diff --git a/docs/topics/i18n/translation.txt b/docs/topics/i18n/translation.txt index f942ad760d..a60a0a2161 100644 --- a/docs/topics/i18n/translation.txt +++ b/docs/topics/i18n/translation.txt @@ -1476,7 +1476,7 @@ Make sure that the following item is in your Activate this view by adding the following line to your URLconf:: - (r'^i18n/', include('django.conf.urls.i18n')), + url(r'^i18n/', include('django.conf.urls.i18n')), (Note that this example makes the view available at ``/i18n/setlang/``.)