@@ -362,6 +362,10 @@ def db_url_config(cls, url, engine=None):
362362 {'ENGINE': 'django.db.backends.postgresql', 'HOST': 'ec2-107-21-253-135.compute-1.amazonaws.com', 'NAME': 'd8r82722r2kuvn', 'PASSWORD': 'wegauwhgeuioweg', 'PORT': 5431, 'USER': 'uf07k1i6d8ia0v'}
363363
364364 """
365+ # Return blank configuration when url is null or empty
366+ if not url :
367+ return {}
368+
365369 if not isinstance (url , cls .URL_CLASS ):
366370 if url == 'sqlite://:memory:' :
367371 # this is a special case, because if we pass this URL into
@@ -447,6 +451,10 @@ def cache_url_config(cls, url, backend=None):
447451 :param backend:
448452 :return:
449453 """
454+ # Return blank configuration when url is null or empty
455+ if not url :
456+ return {}
457+
450458 url = urlparse (url ) if not isinstance (url , cls .URL_CLASS ) else url
451459
452460 location = url .netloc .split (',' )
@@ -497,6 +505,10 @@ def email_url_config(cls, url, backend=None):
497505
498506 config = {}
499507
508+ # Return blank configuration when url is null or empty
509+ if not url :
510+ return config
511+
500512 url = urlparse (url ) if not isinstance (url , cls .URL_CLASS ) else url
501513
502514 # Remove query strings
@@ -540,6 +552,10 @@ def email_url_config(cls, url, backend=None):
540552 def search_url_config (cls , url , engine = None ):
541553 config = {}
542554
555+ # Return blank configuration when url is null or empty
556+ if not url :
557+ return config
558+
543559 url = urlparse (url ) if not isinstance (url , cls .URL_CLASS ) else url
544560
545561 # Remove query strings.
0 commit comments