Hello everyone,
I started by creating a flask application and then did authentication for it.
In the authentication function I saved the user profile in the session.
However when I want to access it on any other file on the application I get the following error:
RuntimeError: Working outside of request context.
This typically means that you attempted to use functionality that needed
an active HTTP request. Consult the documentation on testing for
information about how to avoid this problem.
the simplified code is like this
from layout import layout
from flask import session
dash_app = dash.Dash("myapp",server=flask_app)
if session is None:
layout = html.Div([dcc.Location(id='anId', pathname='/login')])
else:
layout = layout
1 post - 1 participant






