Skip to main content
Version: 0.2.0

get_server

FunctionPrivateSource

server: flask.Flask = get_server(app: dash.Dash | flask.Flask)

Get the Flask server instance from the application.

Arguments​

Requires​

ArgumentTypeRequired
Description
appdash.Dash | flask.FlaskCan 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​

ArgumentType
Description
serverflask.FlaskThe Flask server instance of the given app.

Examples​

Get the server​

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))