Skip to content

Commit 7835b33

Browse files
committed
adding better doc string
1 parent ed91bd6 commit 7835b33

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

dash/dash.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,20 @@ def _setup_routes(self):
785785
self._add_url("<path:path>", self.index)
786786

787787
def setup_apis(self):
788-
# Copy over global callback data structures assigned with `dash.callback`
788+
"""
789+
Register API endpoints for all callbacks defined using `dash.callback`.
790+
791+
This method must be called after all callbacks are registered and before the app is served.
792+
It ensures that all callback API routes are available for the Dash app to function correctly.
793+
794+
Typical usage:
795+
app = Dash(__name__)
796+
# Register callbacks here
797+
app.setup_apis()
798+
app.run()
799+
800+
If not called, callback endpoints will not be available and the app will not function as expected.
801+
"""
789802
for k in list(_callback.GLOBAL_API_PATHS):
790803
if k in self.callback_api_paths:
791804
raise DuplicateCallback(

0 commit comments

Comments
 (0)