mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
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>
This commit is contained in:
parent
580e644f24
commit
c574bec092
5 changed files with 99 additions and 2 deletions
|
@ -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``
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue