Code

Ticket #10079: 10079-reusable-context.2.diff

File 10079-reusable-context.2.diff, 874 bytes (added by mcroydon, 5 years ago)
Line 
1diff --git a/django/template/context.py b/django/template/context.py
2index 1f13659..24c0dfd 100644
3--- a/django/template/context.py
4+++ b/django/template/context.py
5@@ -1,7 +1,3 @@
6-from django.conf import settings
7-from django.core.exceptions import ImproperlyConfigured
8-from django.utils.importlib import import_module
9-
10 _standard_context_processors = None
11 
12 class ContextPopException(Exception):
13@@ -71,6 +67,9 @@ class Context(object):
14 # This is a function rather than module-level procedural code because we only
15 # want it to execute if somebody uses RequestContext.
16 def get_standard_processors():
17+    from django.conf import settings
18+    from django.core.exceptions import ImproperlyConfigured
19+    from django.utils.importlib import import_module
20     global _standard_context_processors
21     if _standard_context_processors is None:
22         processors = []