diff options
| author | Jannis Leidel <jannis@leidel.info> | 2011-01-02 01:33:11 +0000 |
|---|---|---|
| committer | Jannis Leidel <jannis@leidel.info> | 2011-01-02 01:33:11 +0000 |
| commit | 544ab30ed71e0d78c4c061008758de29ff79e8f7 (patch) | |
| tree | 55c710a12a6552bd461d621e38c0d6fa526f5ef6 /docs | |
| parent | 7a89d3d503cad96689fee3028a218ff5456f73f1 (diff) | |
Fixed #6218 -- Made MEDIA_URL and STATIC_URL require a trailing slash to ensure there is a consistent way to combine paths in templates. Thanks to Michael Toomim, Chris Heisel and Chris Beaven.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15130 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/internals/deprecation.txt | 4 | ||||
| -rw-r--r-- | docs/ref/settings.txt | 8 | ||||
| -rw-r--r-- | docs/releases/1.3.txt | 16 |
3 files changed, 24 insertions, 4 deletions
diff --git a/docs/internals/deprecation.txt b/docs/internals/deprecation.txt index 508e6f2a6e..4613b7e3ee 100644 --- a/docs/internals/deprecation.txt +++ b/docs/internals/deprecation.txt @@ -101,6 +101,10 @@ their deprecation, as per the :ref:`Django deprecation policy * Authentication backends need to define the boolean attribute ``supports_inactive_user``. + * The ``MEDIA_URL`` or ``STATIC_URL`` settings are required to end + with a trailing slash to ensure there is a consistent way to + combine paths in templates. + * 1.5 * The ``mod_python`` request handler has been deprecated since the 1.3 release. The ``mod_wsgi`` handler should be used instead. diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index 3b65f1461f..87a71fe6ed 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -1251,10 +1251,8 @@ for :doc:`managing stored files </topics/files>`. Example: ``"http://media.lawrence.com/"`` -Note that this should have a trailing slash if it has a path component. - - * Good: ``"http://www.example.com/media/"`` - * Bad: ``"http://www.example.com/media"`` +.. versionchanged:: 1.3 + It must end in a slash if set to a non-empty value. MESSAGE_LEVEL ------------- @@ -1664,6 +1662,8 @@ If not ``None``, this will be used as the base path for :ref:`media definitions<form-media-paths>` and the :doc:`staticfiles app</ref/contrib/staticfiles>`. +It must end in a slash if set to a non-empty value. + See :setting:`STATIC_ROOT`. .. setting:: TEMPLATE_CONTEXT_PROCESSORS diff --git a/docs/releases/1.3.txt b/docs/releases/1.3.txt index 4a5631e264..8928bee5ee 100644 --- a/docs/releases/1.3.txt +++ b/docs/releases/1.3.txt @@ -192,6 +192,22 @@ The GeoDjango test suite is now included when :ref:`running the Django test suite <running-unit-tests>` with ``runtests.py`` when using :ref:`spatial database backends <spatial-backends>`. +``MEDIA_URL`` and ``STATIC_URL`` must end in a slash +---------------------------------------------------- + +Previously, the ``MEDIA_URL`` setting only required a trailing slash if it +contained a suffix beyond the domain name. + +A trailing slash is now *required* for ``MEDIA_URL`` and the new +``STATIC_URL`` setting as long as it is not blank. This ensures there is +a consistent way to combine paths in templates. + +Project settings which provide either of both settings without a trailing +slash will now raise a ``PendingDeprecation`` warning. + +In Django 1.4 this same condition will raise an ``ImproperlyConfigured`` +exception. + Everything else ~~~~~~~~~~~~~~~ |
