TLDR : What is the opposite of dash_app.init_app(flask_app) ? How to remove a dash app from a flask app ?
I’m using a factory pattern to run dash apps :
Create Flask App (server) in server.py
Create oAuth registry (oauth) from Authlib in server.py
Define my Dash apps without a server in python packages (folders with init.py)
Load my Dash Apps into the Flask server in run.py, right before I run the server.
|---server.py |---run.py |---load_dash_apps.py |---requirements.txt |---git... |---Dash_App1 |---__init__.py (def the dash) |---layout.py |-... |---Dash_App2 |---__init__.py (def the dash) |---layout.py |-... |---Home |---__init__.py (def the dash) |---layout.py |-...
Every dash app is loaded through load_dash_apps.py.
Every dash app has the same navigator bar on top, and a content part.
The home app only has the navigator and is the first redirect after login.
The navigator allows to go from one dash to another.
What I want to do is to load only one app (starting with home), and when I click on the links in navbar, to redirect to a loader link with the requested app name as argument (url_for(“load_apps”,“the_requested_app”)). This url would remove the previously loaded app and load the requested app, in order to have one and only one dash app loaded at a time.
Basically, I want to undo dash_app.init_app(flask_app).