File tree Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Expand file tree Collapse file tree 2 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,13 @@ def wrap(*args, **kwargs):
3939
4040
4141def get_app ():
42+ """
43+ Return the current Dash app instance.
44+
45+ Useful in multi-page apps when Python files within the `pages/` folder
46+ need to reference the `app` object but importing it directly would cause
47+ a circular import error.
48+ """
4249 try :
4350 ctx_app = app_context .get ()
4451 if ctx_app is not None :
Original file line number Diff line number Diff line change @@ -937,13 +937,17 @@ def _config(self):
937937 "plotly_version" : plotly_version ,
938938 }
939939 if self ._plotly_cloud is None :
940- try :
941- # pylint: disable=C0415,W0611
942- import plotly_cloud # noqa: F401
943-
940+ if os .getenv ("DASH_ENTERPRISE_ENV" ) == "WORKSPACE" :
941+ # Disable the placeholder button on workspace.
944942 self ._plotly_cloud = True
945- except ImportError :
946- self ._plotly_cloud = False
943+ else :
944+ try :
945+ # pylint: disable=C0415,W0611
946+ import plotly_cloud # noqa: F401
947+
948+ self ._plotly_cloud = True
949+ except ImportError :
950+ self ._plotly_cloud = False
947951
948952 config ["plotly_cloud_installed" ] = self ._plotly_cloud
949953 if not self .config .serve_locally :
You can’t perform that action at this time.
0 commit comments