Skip to content

Commit 89f1b78

Browse files
authored
Merge branch 'dev' into deprecate-dash-table
2 parents 48516d0 + 0221a97 commit 89f1b78

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

dash/_get_app.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ def wrap(*args, **kwargs):
3939

4040

4141
def 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:

dash/dash.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff 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:

0 commit comments

Comments
 (0)