Hi there,
I doing the online course with Adam and try to do a own pages with core elements and px graphs. I have two questions.
My dropdown/ radio is empty and have no values. Do I have a wrong syntax? Or have it to do with my python version 3.8 and dash version 1.21, plotly 4.14 ?
I had to integrate a flask server and to do the callback via the instance @app.callback(). It do not work like in the example from Adam with @callback(…). Is this a short from or a newer feature?
not sure what is the issue there. It should not be necessary to use Flask. I had to comment out some stuff due to lack of your data, could you verify if this works on your side (except for the ineractivity):
Hi @AIMPED,
thanks for the reply.
I just take our code and get an error at the dash import. I had to change to
from flask import Flask
import pandas as pd
import dash
from dash.dependencies import Input, Output, State # , callback
import dash_html_components as html
import dash_core_components as dcc
after running this I get an error at the run call:
app.run(debug=True)
This is our solution for an app project. Ok, I will update. At minium for the course and this example. In my other project, I have first check the dependencies…
Thanks.
I guess your server code part is the root cause of your symptom,
on pyhton 3.12.0 using Plotly 5.17.0 and Dash 2.13.0,
and as AIMPED mentioned without importing Flask
with coding
import pandas as pd
from dash import Dash, dcc, html, Input, Output
import dash
import plotly.express as px
df = pd.read_csv('Dash-Course_makeup-shades.csv')
fig = px.histogram(df, x='brand', y='H', histfunc='avg')
app = Dash(__name__)
#server = app.server # this is the server setting part without Flask
#app = dash.Dash(server=server, url_base_pathname='/1A/' )
together with the rest of your code at my side everything looks fine, dropdown and radio buttons are there with content for selection.
By using a server mechanism like for deployment, have you set your application server handling appropriately (gunicorn or uvicorn), because there is no import here and the run is not as expected?
Hi Adam,
yes I used yesterday WasmDash and this is really great - you can directly start with the training. I will use this for the exercise and I will try later to correct my ‘new’ sandbox. Is there a possibility to save my demo app or just to copy to local file? Thanks.