summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorOleg Kainov <kainov.oleg@gmail.com>2018-12-05 16:15:33 -0800
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2019-09-25 19:47:03 +0200
commitc574bec0929cd2527268c96a492d25223a9fd576 (patch)
tree80c642eca0ca64d63d1596bc237465685c92ce5c /docs
parent580e644f24f1c5ae5b94784fb73a9953a178fd26 (diff)
Fixed #25598 -- Added SCRIPT_NAME prefix to STATIC_URL and MEDIA_URL set to relative paths.
Thanks Florian Apolloner for reviews. Co-authored-by: Joel Dunham <Joel.Dunham@technicalsafetybc.ca>
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/settings.txt14
-rw-r--r--docs/releases/3.1.txt5
2 files changed, 19 insertions, 0 deletions
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
index 00538ccbf7..4405d152b2 100644
--- a/docs/ref/settings.txt
+++ b/docs/ref/settings.txt
@@ -1989,6 +1989,13 @@ Example: ``"http://media.example.com/"``
:setting:`MEDIA_URL` and :setting:`STATIC_URL` must have different
values. See :setting:`MEDIA_ROOT` for more details.
+.. note::
+
+ If :setting:`MEDIA_URL` is a relative path, then it will be prefixed by the
+ server-provided value of ``SCRIPT_NAME`` (or ``/`` if not set). This makes
+ it easier to serve a Django application in a subpath without adding an
+ extra configuration to the settings.
+
.. setting:: MIDDLEWARE
``MIDDLEWARE``
@@ -3306,6 +3313,13 @@ You may need to :ref:`configure these files to be served in development
<serving-static-files-in-development>` and will definitely need to do so
:doc:`in production </howto/static-files/deployment>`.
+.. note::
+
+ If :setting:`STATIC_URL` is a relative path, then it will be prefixed by
+ the server-provided value of ``SCRIPT_NAME`` (or ``/`` if not set). This
+ makes it easier to serve a Django application in a subpath without adding
+ an extra configuration to the settings.
+
.. setting:: STATICFILES_DIRS
``STATICFILES_DIRS``
diff --git a/docs/releases/3.1.txt b/docs/releases/3.1.txt
index 3a9381626b..da954bab56 100644
--- a/docs/releases/3.1.txt
+++ b/docs/releases/3.1.txt
@@ -233,6 +233,11 @@ Miscellaneous
* The compatibility imports of ``Context``, ``ContextPopException``, and
``RequestContext`` in ``django.template.base`` are removed.
+* The :setting:`STATIC_URL` and :setting:`MEDIA_URL` settings set to relative
+ paths are now prefixed by the server-provided value of ``SCRIPT_NAME`` (or
+ ``/`` if not set). This change should not affect settings set to valid URLs
+ or absolute paths.
+
.. _deprecated-features-3.1:
Features deprecated in 3.1