MCPcopy Index your code
hub / github.com/plotly/dash / validate_use_pages

Function validate_use_pages

dash/_validate.py:508–524  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

506
507
508def validate_use_pages(config):
509 if not config.get("assets_folder", None):
510 raise exceptions.PageError(
511 "`dash.register_page()` must be called after app instantiation"
512 )
513
514 try:
515 if get_app().backend.has_request_context():
516 raise exceptions.PageError(
517 """
518 dash.register_page() can’t be called within a callback as it updates dash.page_registry, which is a global variable.
519 For more details, see https://dash.plotly.com/sharing-data-between-callbacks#why-global-variables-will-break-your-app
520 """
521 )
522 except exceptions.AppNotFoundError:
523 # If the app is not found we can add pages since before instantiation.
524 pass
525
526
527def validate_module_name(module):

Callers

nothing calls this directly

Calls 3

get_appFunction · 0.90
getMethod · 0.45
has_request_contextMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…