How pass a parameter to DASH from FLASK

I am trying to run a dash app inside a flask application as follows and i am trying to pass a FLASK input parameter (date passed as POST) to DASH, can you please let me know how to pass the DATE parameter from FLASK to DASH.

from @server.route("/home", methods=[“GET”,“POST”])

to file = ‘test_file_{}.dat’.format(DATE)

import flask
from flask import Flask, flash, render_template
import dash
import dash_html_components as html
import dash_core_components as dcc
from werkzeug.wsgi import DispatcherMiddleware
from werkzeug.serving import run_simple
import pandas as pd

server = flask.Flask(__name__)

def welcome():
   return render_template("home.html")

@server.route("/home", methods=["GET","POST"])
def home():
     if request.method=="POST":
          DATE = request.form["date"]
               return render_template("success.html")
          except ClientError as e:
               return render_template("failure.html")
          return render_template("home.html")

dash_app = dash.Dash(

file = 'test_file_{}.dat'.format(DATE)

df = pd.read_csv(file, header = 0)

colors = {
    'background': '#111111',
    'text': '#7FDBFF'
dash_app.layout = html.Div(style={'backgroundColor': colors['background']}, children=[
        children='Hello Dash',
            'textAlign': 'center',
            'color': colors['text']
    html.Div(children='Dash: A web application framework for Python.', style={
        'textAlign': 'center',
        'color': colors['text']
            'data': [
                {'x':df['col1'], 'y':df['col2'], 'type': 'bar', 'name': 'SF'},
                {'x':df['col1'], 'y':df['col3'], 'type': 'bar', 'name': u'Montréal'},
            'layout': {
                'plot_bgcolor': colors['background'],
                'paper_bgcolor': colors['background'],
                'font': {
                    'color': colors['text']

def render_dashboard():
    return flask.redirect('/dash1')

app = DispatcherMiddleware(server, {
    '/dash1': dash_app.server

if __name__== "__main__":
     run_simple('', 8090, app, use_reloader=True, use_debugger=True)

Hey ! I’m sure this is not the best way to do it, but, you can register what you want into a session, and then access that session from dash.

@app.route('/' , methods=['GET', 'POST'])
def landing_page():
    dashboard_id = request.args.get('dashboard_id')
    session['dashboard_id'] = dashboard_id
    return redirect("/dash/")

that session is then available inside callbacks.

	[Output('store_client_id', 'data')],
	[Input('div3', 'children')])
    def update_user(children):
            s = session.get('dashboard_id', None)
            return s
            return -10

in this case i’m sending the value back to a div, but you can just access it directly from any callback you choose.

Have you solved this problem yet? I’m stuck like you
can you give me the solution please?