get_server
FunctionPrivateSource
server: flask.Flask = get_server(app: dash.Dash | flask.Flask)
Get the Flask server instance from the application.
Arguments
Requires
Argument | Type | Required | |
---|---|---|---|
app | dash.Dash | flask.Flask | Can be either a dash or a flask app. If it is a dash app, try to fetch the flask server instance. Otherwise, return the flask app directly. |
Returns
Argument | Type | |
---|---|---|
server | flask.Flask | The Flask server instance of the given app . |
Examples
Get the server
- Codes
- Results
import dash
import flask
from dash_file_cache.services.utilities import get_server
app1 = dash.Dash("demo1")
app2 = flask.Flask("demo2")
print(get_server(app1))
print(get_server(app2))
<Flask 'demo1'>
<Flask 'demo2'>