소스 검색

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

Sarah Boyce 2 년 전
부모
커밋
bdf59bff65
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      docs/ref/urlresolvers.txt

+ 5 - 0
docs/ref/urlresolvers.txt

@@ -236,3 +236,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.