1
0
mirror of https://github.com/django/django.git synced 2025-04-01 12:06:43 +00:00

[4.2.x] Refs #34028 -- Doc'd that get_script_prefix() cannot be used outside of the request-response cycle.

Backport of bdf59bff657975e577b86b194b39ec2f77983d2b from main
This commit is contained in:
Sarah Boyce 2023-04-06 13:01:26 +02:00 committed by Mariusz Felisiak
parent 32cfa73c6a
commit e34a54a36e

View File

@ -240,3 +240,8 @@ its web server (normally, :func:`~django.urls.reverse` takes care of this for
you). In that case, you can call ``get_script_prefix()``, which will return
the script prefix portion of the URL for your Django project. If your Django
project is at the root of its web server, this is always ``"/"``.
.. warning::
This function **cannot** be used outside of the request-response cycle
since it relies on values initialized during that cycle.