cleanup the code

This commit is contained in:
MardanovTimur 2019-05-22 01:00:30 +03:00
parent 4f2fb3ebea
commit 76fbcefbc7

View File

@ -37,13 +37,19 @@ DEFAULTS = {
"RELAY_CONNECTION_MAX_LIMIT": 100, "RELAY_CONNECTION_MAX_LIMIT": 100,
} }
try:
def init_midleware():
if settings.DEBUG: if settings.DEBUG:
DEFAULTS["MIDDLEWARE"] += ("graphene_django.debug.DjangoDebugMiddleware",) DEFAULTS["MIDDLEWARE"] += ("graphene_django.debug.DjangoDebugMiddleware",)
try:
init_midleware()
except Exception: except Exception:
if not settings.configured: if not settings.configured:
# configure the settings
settings.configure() settings.configure()
finally:
init_midleware()