@@ -74,7 +74,7 @@ def component(
74
74
</body>
75
75
</html>
76
76
"""
77
- from django . conf import settings as django_settings
77
+ from reactpy_django . config import DJANGO_DEBUG
78
78
79
79
request : HttpRequest | None = context .get ("request" )
80
80
perceived_host = (request .get_host () if request else "" ).strip ("/" )
@@ -95,7 +95,7 @@ def component(
95
95
_offline_html = ""
96
96
97
97
# Validate the host
98
- if host and django_settings . DEBUG :
98
+ if host and DJANGO_DEBUG :
99
99
try :
100
100
validate_host (host )
101
101
except InvalidHostError as e :
@@ -110,7 +110,7 @@ def component(
110
110
return failure_context (dotted_path , ComponentDoesNotExistError (msg ))
111
111
112
112
# Validate the component args & kwargs
113
- if is_local and django_settings . DEBUG :
113
+ if is_local and DJANGO_DEBUG :
114
114
try :
115
115
validate_component_args (user_component , * args , ** kwargs )
116
116
except ComponentParamError as e :
@@ -236,21 +236,21 @@ def pyscript_setup(
236
236
config: A JSON string or Python dictionary containing PyScript \
237
237
configuration values.
238
238
"""
239
- from django . conf import settings as django_settings
239
+ from reactpy_django . config import DJANGO_DEBUG
240
240
241
241
return {
242
242
"pyscript_config" : extend_pyscript_config (extra_py , extra_js , config ),
243
243
"pyscript_layout_handler" : PYSCRIPT_LAYOUT_HANDLER ,
244
- "django_debug" : django_settings . DEBUG ,
244
+ "django_debug" : DJANGO_DEBUG ,
245
245
}
246
246
247
247
248
248
def failure_context (dotted_path : str , error : Exception ):
249
- from django . conf import settings as django_settings
249
+ from reactpy_django . config import DJANGO_DEBUG
250
250
251
251
return {
252
252
"reactpy_failure" : True ,
253
- "django_debug" : django_settings . DEBUG ,
253
+ "django_debug" : DJANGO_DEBUG ,
254
254
"reactpy_dotted_path" : dotted_path ,
255
255
"reactpy_error" : type (error ).__name__ ,
256
256
}
0 commit comments