aaron-schroeder / distilling-flask

Strava app for display and analysis of personal running data, powered by Flask, Dash, and Pandas.
MIT License
3 stars 0 forks source link

Create a universal `url_4` that works across dash and flask #75

Open aaron-schroeder opened 1 year ago

aaron-schroeder commented 1 year ago

The dash page registry is kind of a black box to me. Where it's accessible, how it stores its routing information, etc. But I think it holds the key to writing a function that can serve as a combination of url_for and

For dash page routing, I have stuck to mostly hardcoding route urls, with a small amount of hacky uses of the dash page registry.

Example entry in dash.page_registry ordered dict:

(pages.training_stress, {'module': 'pages.training_stress', 'supplied_path': None, 'path_template': '/stress', 'path': '/stress', 'supplied_name': 'Training Stress Dashboard', 'name': 'Training Stress Dashboard', 'supplied_title': 'Training Stress Dashboard', 'title': 'Training Stress Dashboard', 'description': '', 'order': None, 'supplied_order': None, 'supplied_layout': None, 'supplied_image': None, 'image': None, 'image_url': None, 'redirect_from': None, 'relative_path': '/stress', 'layout': <function layout at 0x7faaf6c1b700>}

References