Code Monkey home page Code Monkey logo

Comments (4)

emilhe avatar emilhe commented on June 14, 2024

Where do you see that it is a dash-extensions error?

from dash-extensions.

linqingfan avatar linqingfan commented on June 14, 2024

It seems to me flask login manager cannot be used when using dash_extensions.
This error appears:
AttributeError: 'Flask' object has no attribute 'login_manager'

`
app = Dash(prevent_initial_callbacks=True)

navBar = dbc.Navbar(id='navBar',
children=[],
sticky='top',
color='primary',
className='navbar navbar-expand-lg navbar-dark bg-primary',
)

app.layout = html.Div([
dcc.Store(id='server-memory-storage'),
html.Div(id="onload"), # this div is used to trigger the query_df function on page load
html.Label(id='contentoftest1'),
dcc.Location(id='url', refresh=False),
html.Div([
navBar,
html.Div(id='pageContent')
])
], id='table-wrapper')

@app.callback(ServersideOutput("server-memory-storage", "data"), Trigger("onload", "children"))
def store_variable():
print("store_variable")
data = test1
return(data)

@app.callback(Output("contentoftest1", "children"), ServerInput("server-memory-storage", "data"))
def print_df(df):
print("print")
return str(df.x) # do something with the data

#print(current_user.is_authenticated)

@app.callback(Output('pageContent', 'children'),
[Input('url', 'pathname')])
def displayPage(pathname):
if pathname == '/':
if current_user.is_authenticated:
return page1.layout
else:
return login.layout
elif pathname == '/logout':
if current_user.is_authenticated:
logout_user()
return login.layout
else:
return login.layout
`

When I change app = Dash(prevent_initial_callbacks=True) to from app import app, the ServersideOutput cannot work

from dash-extensions.

emilhe avatar emilhe commented on June 14, 2024

I am not sure I understand what is going on. Could you post an MWE that works with vanilla Dash, but not with dash-extensions?

from dash-extensions.

emilhe avatar emilhe commented on June 14, 2024

Closed due to inactivity.

from dash-extensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.