I am trying to use Dash and Flask for the first time. My purpose is to develop a single page webapp with some graphs, restricted for few users only using Google OAuth2 API.
Here is a snippet of my code:
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] # Setup the Flask server server = Flask(__name__) app = dash.Dash(__name__, server=server, url_base_pathname='/', external_stylesheets=external_stylesheets) app.layout = [some fancy layout here...] @server.route('/') def index(): return redirect(url_for('/login')) @server.route('/login') def login(): [all my Google OAuth login logic here...] return redirect(url_for('/')) [...] if __name__ == '__main__': app.run_server(debug=True, ssl_context='adhoc')
It does not even redirect to the login page, it just displays my app layout as usual. I don’t really know if my problem is either Dash related or Flask related, but I would give a try to get some help on this forum. Can anyone help me on this one ?