summaryrefslogtreecommitdiff
path: root/django/template
diff options
context:
space:
mode:
authorrajdesai24 <53701807+rajdesai24@users.noreply.github.com>2023-01-06 18:48:29 +0530
committerGitHub <noreply@github.com>2023-01-06 14:18:29 +0100
commitd5f892d873c6f98178121214f3c00d284ae1296d (patch)
tree82a2f01297a04337ab0b0e7ae56e00eb74bb9811 /django/template
parentb47f2f5b907732d80b164f1f361ae39da94a3fa6 (diff)
Fixed #34220 -- Moved csrf_input_lazy, csrf_token_lazy imports to the toplevel.
This prevents random errors with partially initialized modules.
Diffstat (limited to 'django/template')
-rw-r--r--django/template/backends/jinja2.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/django/template/backends/jinja2.py b/django/template/backends/jinja2.py
index 199d62b429..031278c2e2 100644
--- a/django/template/backends/jinja2.py
+++ b/django/template/backends/jinja2.py
@@ -8,6 +8,7 @@ from django.utils.functional import cached_property
from django.utils.module_loading import import_string
from .base import BaseEngine
+from .utils import csrf_input_lazy, csrf_token_lazy
class Jinja2(BaseEngine):
@@ -62,8 +63,6 @@ class Template:
)
def render(self, context=None, request=None):
- from .utils import csrf_input_lazy, csrf_token_lazy
-
if context is None:
context = {}
if request is not None: