From 7a405299b104d5dabce4e199f94529375499eab1 Mon Sep 17 00:00:00 2001 From: Mark Gibbs Date: Sun, 13 Jan 2019 19:33:54 -0800 Subject: [PATCH] Make static finders handle case of missing settings gracefully --- django_plotly_dash/finders.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/django_plotly_dash/finders.py b/django_plotly_dash/finders.py index 2c23a911..21db26aa 100644 --- a/django_plotly_dash/finders.py +++ b/django_plotly_dash/finders.py @@ -50,7 +50,12 @@ def __init__(self): self.ignore_patterns = ["*.py", "*.pyc",] - for component_name in settings.PLOTLY_COMPONENTS: + try: + components = settings.PLOTLY_COMPONENTS + except: + components = [] + + for component_name in components: module = importlib.import_module(component_name) path_directory = os.path.dirname(module.__file__)