Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
b09faa49
Kaydet (Commit)
b09faa49
authored
Ock 27, 2017
tarafından
Dmitry Gladkov
Kaydeden (comit)
Tim Graham
Ock 27, 2017
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #27748 -- Switched HTTP error handlers to reference callables instead of strings.
üst
c8d21f33
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
20 deletions
+13
-20
__init__.py
django/conf/urls/__init__.py
+5
-4
urls.txt
docs/ref/urls.txt
+4
-16
2.0.txt
docs/releases/2.0.txt
+4
-0
No files found.
django/conf/urls/__init__.py
Dosyayı görüntüle @
b09faa49
...
@@ -4,13 +4,14 @@ from django.core.exceptions import ImproperlyConfigured
...
@@ -4,13 +4,14 @@ from django.core.exceptions import ImproperlyConfigured
from
django.urls
import
(
from
django.urls
import
(
LocaleRegexURLResolver
,
RegexURLPattern
,
RegexURLResolver
,
LocaleRegexURLResolver
,
RegexURLPattern
,
RegexURLResolver
,
)
)
from
django.views
import
defaults
__all__
=
[
'handler400'
,
'handler403'
,
'handler404'
,
'handler500'
,
'include'
,
'url'
]
__all__
=
[
'handler400'
,
'handler403'
,
'handler404'
,
'handler500'
,
'include'
,
'url'
]
handler400
=
'django.views.defaults.bad_request'
handler400
=
defaults
.
bad_request
handler403
=
'django.views.defaults.permission_denied'
handler403
=
defaults
.
permission_denied
handler404
=
'django.views.defaults.page_not_found'
handler404
=
defaults
.
page_not_found
handler500
=
'django.views.defaults.server_error'
handler500
=
defaults
.
server_error
def
include
(
arg
,
namespace
=
None
):
def
include
(
arg
,
namespace
=
None
):
...
...
docs/ref/urls.txt
Dosyayı görüntüle @
b09faa49
...
@@ -90,13 +90,10 @@ A callable, or a string representing the full Python import path to the view
...
@@ -90,13 +90,10 @@ A callable, or a string representing the full Python import path to the view
that should be called if the HTTP client has sent a request that caused an error
that should be called if the HTTP client has sent a request that caused an error
condition and a response with a status code of 400.
condition and a response with a status code of 400.
By default, this is
``'django.views.defaults.bad_request'`
`. If you
By default, this is
:func:`django.views.defaults.bad_request
`. If you
implement a custom view, be sure it returns an
implement a custom view, be sure it returns an
:class:`~django.http.HttpResponseBadRequest`.
:class:`~django.http.HttpResponseBadRequest`.
See the documentation about :ref:`the 400 (bad request) view
<http_bad_request_view>` for more information.
``handler403``
``handler403``
==============
==============
...
@@ -106,13 +103,10 @@ A callable, or a string representing the full Python import path to the view
...
@@ -106,13 +103,10 @@ A callable, or a string representing the full Python import path to the view
that should be called if the user doesn't have the permissions required to
that should be called if the user doesn't have the permissions required to
access a resource.
access a resource.
By default, this is
``'django.views.defaults.permission_denied'`
`. If you
By default, this is
:func:`django.views.defaults.permission_denied
`. If you
implement a custom view, be sure it returns an
implement a custom view, be sure it returns an
:class:`~django.http.HttpResponseForbidden`.
:class:`~django.http.HttpResponseForbidden`.
See the documentation about :ref:`the 403 (HTTP Forbidden) view
<http_forbidden_view>` for more information.
``handler404``
``handler404``
==============
==============
...
@@ -121,13 +115,10 @@ See the documentation about :ref:`the 403 (HTTP Forbidden) view
...
@@ -121,13 +115,10 @@ See the documentation about :ref:`the 403 (HTTP Forbidden) view
A callable, or a string representing the full Python import path to the view
A callable, or a string representing the full Python import path to the view
that should be called if none of the URL patterns match.
that should be called if none of the URL patterns match.
By default, this is
``'django.views.defaults.page_not_found'`
`. If you
By default, this is
:func:`django.views.defaults.page_not_found
`. If you
implement a custom view, be sure it returns an
implement a custom view, be sure it returns an
:class:`~django.http.HttpResponseNotFound`.
:class:`~django.http.HttpResponseNotFound`.
See the documentation about :ref:`the 404 (HTTP Not Found) view
<http_not_found_view>` for more information.
``handler500``
``handler500``
==============
==============
...
@@ -137,9 +128,6 @@ A callable, or a string representing the full Python import path to the view
...
@@ -137,9 +128,6 @@ A callable, or a string representing the full Python import path to the view
that should be called in case of server errors. Server errors happen when you
that should be called in case of server errors. Server errors happen when you
have runtime errors in view code.
have runtime errors in view code.
By default, this is
``'django.views.defaults.server_error'`
`. If you
By default, this is
:func:`django.views.defaults.server_error
`. If you
implement a custom view, be sure it returns an
implement a custom view, be sure it returns an
:class:`~django.http.HttpResponseServerError`.
:class:`~django.http.HttpResponseServerError`.
See the documentation about :ref:`the 500 (HTTP Internal Server Error) view
<http_internal_server_error_view>` for more information.
docs/releases/2.0.txt
Dosyayı görüntüle @
b09faa49
...
@@ -217,6 +217,10 @@ Miscellaneous
...
@@ -217,6 +217,10 @@ Miscellaneous
functionality since session authentication is unconditionally enabled in
functionality since session authentication is unconditionally enabled in
Django 1.10.
Django 1.10.
* The default HTTP error handlers (``handler404``, etc.) are now callables
instead of dotted Python path strings. Django favors callable references
since they provide better performance and debugging experience.
.. _deprecated-features-2.0:
.. _deprecated-features-2.0:
Features deprecated in 2.0
Features deprecated in 2.0
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment