Skip to content

Commit ca570d7

Browse files
authored
Merge pull request #294 from rmarren1/no-layout-error
Error when no layout is present.
2 parents f309cc2 + d7e68cb commit ca570d7

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

Diff for: dash/dash.py

+9
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,15 @@ def dispatch(self):
558558
return self.callback_map[target_id]['callback'](*args)
559559

560560
def _setup_server(self):
561+
# Make sure `layout` is set before running the server
562+
value = getattr(self, 'layout')
563+
if value is None:
564+
raise exceptions.NoLayoutException(
565+
''
566+
'The layout was `None` '
567+
'at the time that `run_server` was called. '
568+
'Make sure to set the `layout` attribute of your application '
569+
'before running the server.')
561570
self._generate_scripts_html()
562571
self._generate_css_dist_html()
563572

Diff for: dash/exceptions.py

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ class DashException(Exception):
22
pass
33

44

5+
class NoLayoutException(DashException):
6+
pass
7+
8+
59
class CallbackException(DashException):
610
pass
711

Diff for: dev-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ six
1212
plotly>=2.0.8
1313
requests[security]
1414
flake8
15-
pylint
15+
pylint==1.9.2

0 commit comments

Comments
 (0)