mirror of
https://github.com/django/django.git
synced 2025-03-25 08:40:45 +00:00
[1.10.x] Added missing trailing '$' to url() patterns in docs.
Backport of c962b9104a22505a7d6c57bbec9eda163f486c7d from master
This commit is contained in:
parent
b752eae700
commit
b2c28a3770
@ -907,7 +907,7 @@ easiest way is to include the provided URLconf in ``django.contrib.auth.urls``
|
|||||||
in your own URLconf, for example::
|
in your own URLconf, for example::
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url('^', include('django.contrib.auth.urls'))
|
url('^', include('django.contrib.auth.urls')),
|
||||||
]
|
]
|
||||||
|
|
||||||
This will include the following URL patterns::
|
This will include the following URL patterns::
|
||||||
@ -930,7 +930,7 @@ your URLconf::
|
|||||||
from django.contrib.auth import views as auth_views
|
from django.contrib.auth import views as auth_views
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url('^change-password/', auth_views.password_change)
|
url('^change-password/$', auth_views.password_change),
|
||||||
]
|
]
|
||||||
|
|
||||||
The views have optional arguments you can use to alter the behavior of the
|
The views have optional arguments you can use to alter the behavior of the
|
||||||
@ -940,10 +940,10 @@ arguments in the URLconf, these will be passed on to the view. For example::
|
|||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(
|
url(
|
||||||
'^change-password/',
|
'^change-password/$',
|
||||||
auth_views.password_change,
|
auth_views.password_change,
|
||||||
{'template_name': 'change-password.html'}
|
{'template_name': 'change-password.html'}
|
||||||
)
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
All views return a :class:`~django.template.response.TemplateResponse`
|
All views return a :class:`~django.template.response.TemplateResponse`
|
||||||
|
@ -42,7 +42,7 @@ you can simply pass them into the
|
|||||||
from django.views.generic import TemplateView
|
from django.views.generic import TemplateView
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^about/', TemplateView.as_view(template_name="about.html")),
|
url(r'^about/$', TemplateView.as_view(template_name="about.html")),
|
||||||
]
|
]
|
||||||
|
|
||||||
Any arguments passed to :meth:`~django.views.generic.base.View.as_view` will
|
Any arguments passed to :meth:`~django.views.generic.base.View.as_view` will
|
||||||
@ -79,7 +79,7 @@ views::
|
|||||||
from some_app.views import AboutView
|
from some_app.views import AboutView
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^about/', AboutView.as_view()),
|
url(r'^about/$', AboutView.as_view()),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ request to a matching method if one is defined, or raises
|
|||||||
from myapp.views import MyView
|
from myapp.views import MyView
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^about/', MyView.as_view()),
|
url(r'^about/$', MyView.as_view()),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@ -130,7 +130,7 @@ Another option is to configure class attributes as keyword arguments to the
|
|||||||
:meth:`~django.views.generic.base.View.as_view` call in the URLconf::
|
:meth:`~django.views.generic.base.View.as_view` call in the URLconf::
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^about/', GreetingView.as_view(greeting="G'day")),
|
url(r'^about/$', GreetingView.as_view(greeting="G'day")),
|
||||||
]
|
]
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
@ -245,8 +245,8 @@ The easiest place to do this is in the URLconf where you deploy your view::
|
|||||||
from .views import VoteView
|
from .views import VoteView
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^about/', login_required(TemplateView.as_view(template_name="secret.html"))),
|
url(r'^about/$', login_required(TemplateView.as_view(template_name="secret.html"))),
|
||||||
url(r'^vote/', permission_required('polls.can_vote')(VoteView.as_view())),
|
url(r'^vote/$', permission_required('polls.can_vote')(VoteView.as_view())),
|
||||||
]
|
]
|
||||||
|
|
||||||
This approach applies the decorator on a per-instance basis. If you
|
This approach applies the decorator on a per-instance basis. If you
|
||||||
|
Loading…
x
Reference in New Issue
Block a user