mirror of
https://github.com/django/django.git
synced 2025-04-26 02:04:38 +00:00
Made some small tweaks/fixes to documentation from IGNORABLE_404_URLS changeset [16160]
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16275 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
4a4b6b271e
commit
d7036e52ab
@ -130,7 +130,7 @@ def _is_ignorable_404(uri):
|
|||||||
if getattr(settings, 'IGNORABLE_404_STARTS', ()):
|
if getattr(settings, 'IGNORABLE_404_STARTS', ()):
|
||||||
import warnings
|
import warnings
|
||||||
warnings.warn('The IGNORABLE_404_STARTS setting has been deprecated '
|
warnings.warn('The IGNORABLE_404_STARTS setting has been deprecated '
|
||||||
'in favour of IGNORABLE_404_URLS.',
|
'in favor of IGNORABLE_404_URLS.',
|
||||||
PendingDeprecationWarning)
|
PendingDeprecationWarning)
|
||||||
for start in settings.IGNORABLE_404_STARTS:
|
for start in settings.IGNORABLE_404_STARTS:
|
||||||
if uri.startswith(start):
|
if uri.startswith(start):
|
||||||
@ -138,7 +138,7 @@ def _is_ignorable_404(uri):
|
|||||||
if getattr(settings, 'IGNORABLE_404_ENDS', ()):
|
if getattr(settings, 'IGNORABLE_404_ENDS', ()):
|
||||||
import warnings
|
import warnings
|
||||||
warnings.warn('The IGNORABLE_404_ENDS setting has been deprecated '
|
warnings.warn('The IGNORABLE_404_ENDS setting has been deprecated '
|
||||||
'in favour of IGNORABLE_404_URLS.',
|
'in favor of IGNORABLE_404_URLS.',
|
||||||
PendingDeprecationWarning)
|
PendingDeprecationWarning)
|
||||||
for end in settings.IGNORABLE_404_ENDS:
|
for end in settings.IGNORABLE_404_ENDS:
|
||||||
if uri.endswith(end):
|
if uri.endswith(end):
|
||||||
|
@ -84,10 +84,12 @@ crawlers often request::
|
|||||||
import re
|
import re
|
||||||
IGNORABLE_404_URLS = (
|
IGNORABLE_404_URLS = (
|
||||||
re.compile(r'^/apple-touch-icon.*\.png$'),
|
re.compile(r'^/apple-touch-icon.*\.png$'),
|
||||||
re.compile(r'^/favicon.ico$),
|
re.compile(r'^/favicon\.ico$),
|
||||||
re.compile(r'^/robots.txt$),
|
re.compile(r'^/robots\.txt$),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
(Note that these are regular expressions, so we put a backslash in front of
|
||||||
|
periods to escape them.)
|
||||||
|
|
||||||
The best way to disable this behavior is to set
|
The best way to disable this behavior is to set
|
||||||
:setting:`SEND_BROKEN_LINK_EMAILS` to ``False``.
|
:setting:`SEND_BROKEN_LINK_EMAILS` to ``False``.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user