diff options
| author | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-03-31 13:55:03 +0000 |
|---|---|---|
| committer | Aymeric Augustin <aymeric.augustin@m4x.org> | 2012-03-31 13:55:03 +0000 |
| commit | 9ed6e08ff99c18710c0e4875f827235f04c89d76 (patch) | |
| tree | 1781a682463d7c6eb60e39408d8788c2ca3d2fce /docs | |
| parent | 800e3941c50139347ab48e6d6731d445875357ed (diff) | |
Removed deprecated URLField.verify_exists.
The deprecation schedule was slightly accelerated because of possible security ramifications.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@17847 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/forms/fields.txt | 16 | ||||
| -rw-r--r-- | docs/ref/models/fields.txt | 26 | ||||
| -rw-r--r-- | docs/ref/settings.txt | 21 | ||||
| -rw-r--r-- | docs/ref/validators.txt | 22 | ||||
| -rw-r--r-- | docs/topics/forms/modelforms.txt | 3 |
5 files changed, 20 insertions, 68 deletions
diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt index fc8665b252..4956a71b44 100644 --- a/docs/ref/forms/fields.txt +++ b/docs/ref/forms/fields.txt @@ -789,7 +789,7 @@ For each field, we describe the default widget used if you don't specify * Empty value: ``''`` (an empty string) * Normalizes to: A Unicode object. * Validates that the given value is a valid URL. - * Error message keys: ``required``, ``invalid``, ``invalid_link`` + * Error message keys: ``required``, ``invalid`` Takes the following optional arguments: @@ -798,20 +798,6 @@ For each field, we describe the default widget used if you don't specify These are the same as ``CharField.max_length`` and ``CharField.min_length``. - .. attribute:: verify_exists - - If ``True``, the validator will attempt to load the given URL, raising - ``ValidationError`` if the page gives a 404. Defaults to ``False``. - - .. deprecated:: 1.4 - ``verify_exists`` was deprecated for security reasons and will be removed in - Django 1.5. This deprecation also removes ``validator_user_agent``. - - .. attribute:: validator_user_agent - - String used as the user-agent used when checking for a URL's existence. - Defaults to the value of the :setting:`URL_VALIDATOR_USER_AGENT` setting. - .. versionchanged:: 1.2 The URLField previously did not recognize URLs as valid that contained an IDN (Internationalized Domain Name; a domain name containing unicode characters) diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index 8c6a2c9d35..5521a0ed24 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -484,10 +484,10 @@ A :class:`CharField` that checks that the value is a valid email address. .. admonition:: Incompliance to RFCs The default 75 character ``max_length`` is not capable of storing all - possible RFC3696/5321-compliant email addresses. In order to store all - possible valid email addresses, a ``max_length`` of 254 is required. - The default ``max_length`` of 75 exists for historical reasons. The - default has not been changed in order to maintain backwards + possible RFC3696/5321-compliant email addresses. In order to store all + possible valid email addresses, a ``max_length`` of 254 is required. + The default ``max_length`` of 75 exists for historical reasons. The + default has not been changed in order to maintain backwards compatibility with existing uses of :class:`EmailField`. ``FileField`` @@ -887,23 +887,9 @@ shortcuts. ``URLField`` ------------ -.. class:: URLField([verify_exists=False, max_length=200, **options]) +.. class:: URLField([max_length=200, **options]) -A :class:`CharField` for a URL. Has one extra optional argument: - -.. deprecated:: 1.4 - ``verify_exists`` is deprecated for security reasons as of 1.4 and will be - removed in Django 1.5. Prior to 1.3.1, the default value was ``True``. - -.. attribute:: URLField.verify_exists - - If ``True``, the URL given will be checked for existence (i.e., - the URL actually loads and doesn't give a 404 response) using a - ``HEAD`` request. Redirects are allowed, but will not be followed. - - Note that when you're using the single-threaded development server, - validating a URL being served by the same server will hang. This should not - be a problem for multithreaded servers. +A :class:`CharField` for a URL. The admin represents this as an ``<input type="text">`` (a single-line input). diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index c06ef1ad3f..a1a0c76470 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -2148,18 +2148,6 @@ to ensure your processes are running in the correct environment. .. _pytz: http://pytz.sourceforge.net/ -.. setting:: URL_VALIDATOR_USER_AGENT - -URL_VALIDATOR_USER_AGENT ------------------------- - -Default: ``Django/<version> (https://www.djangoproject.com/)`` - -The string to use as the ``User-Agent`` header when checking to see if -URLs exist (see the ``verify_exists`` option on -:class:`~django.db.models.URLField`). This setting was deprecated in -1.3.1 along with ``verify_exists`` and will be removed in 1.4. - .. setting:: USE_ETAGS USE_ETAGS @@ -2344,3 +2332,12 @@ IGNORABLE_404_STARTS .. deprecated:: 1.4 This setting has been superseded by :setting:`IGNORABLE_404_URLS`. + +.. setting:: URL_VALIDATOR_USER_AGENT + +URL_VALIDATOR_USER_AGENT +------------------------ + +.. deprecated:: 1.5 + This value was used as the ``User-Agent`` header when checking if a URL + exists, a feature that was removed due to security and performance issues. diff --git a/docs/ref/validators.txt b/docs/ref/validators.txt index e58e53700d..5b83d26d87 100644 --- a/docs/ref/validators.txt +++ b/docs/ref/validators.txt @@ -88,26 +88,10 @@ to, or in lieu of custom ``field.clean()`` methods. ``URLValidator`` ---------------- -.. class:: URLValidator([verify_exists=False, validator_user_agent=URL_VALIDATOR_USER_AGENT]) +.. class:: URLValidator() - A :class:`RegexValidator` that ensures a value looks like a URL and - optionally verifies that the URL actually exists (i.e., doesn't return a - 404 status code). Raises an error code of ``'invalid'`` if it doesn't look - like a URL, and a code of ``'invalid_link'`` if it doesn't exist. - - :param verify_exists: Sets :attr:`verify_exists`. Defaults to ``False``. - :param validator_user_agent: Sets :attr:`validator_user_agent`. Defaults to - :setting:`URL_VALIDATOR_USER_AGENT` or, if that setting is set to a - null value, ``"Django (https://www.djangoproject.com/)"``. - - .. attribute:: verify_exists - - If set to ``True``, this validator checks that the URL actually exists. - - .. attribute:: validator_user_agent - - If :attr:`verify_exists` is ``True``, Django uses this value as the - "User-agent" for the request. + A :class:`RegexValidator` that ensures a value looks like a URL, and raises + an error code of ``'invalid'`` if it doesn't. ``validate_email`` ------------------ diff --git a/docs/topics/forms/modelforms.txt b/docs/topics/forms/modelforms.txt index d2aa8863fc..6eadf217cc 100644 --- a/docs/topics/forms/modelforms.txt +++ b/docs/topics/forms/modelforms.txt @@ -106,8 +106,7 @@ Model field Form field ``TimeField`` ``TimeField`` -``URLField`` ``URLField`` with ``verify_exists`` set - to the model field's ``verify_exists`` +``URLField`` ``URLField`` =============================== ======================================== .. versionadded:: 1.2 |
