📖 Further Learning: For a complete guide on how to build your beautiful dashboard app in pure Python, check out our best-selling book Python Dash with San Francisco Based publisher NoStarch.
Minute 1: Install Dash
Type the following command in your terminal/shell.
pip install dash
sudo pip install dash
Minute 2: Create Minimal Dash Project File “app.py”
Copy&paste the code into a new file called “
app.py” in a folder – with path
# file app.py import dash import dash_core_components as dcc import dash_html_components as html import plotly.graph_objects as go es = ['https://codepen.io/chriddyp/pen/bWLwgP.css'] app = dash.Dash(__name__, external_stylesheets=es) xs = list(range(30)) ys = [10000 * 1.07**i for i in xs] fig = go.Figure(data=go.Scatter(x=xs, y=ys)) fig.update_layout(xaxis_title='Years', yaxis_title='$') app.layout = html.Div(children=[ html.H1(children='Assets'), dcc.Graph(figure=fig)]) if __name__ == '__main__': app.run_server(debug=True)
Minute 3: Run Dash App
Open a terminal or shell in the
/path/to/dash_app/ and run
python app.py in it:
$ python app.py
Minute 4: Open Dash App in Your Browser
Copy or click on the IP address
127.0.0.1:8050 and open it in your browser.
Python Dash Book
If you’re interested in learning more about how to create beautiful dashboard applications in Python, check out our new book Python Dash.
You’ve seen dashboards before; think election result visualizations you can update in real-time, or population maps you can filter by demographic.
With the Python Dash library, you’ll create analytic dashboards that present data in effective, usable, elegant ways in just a few lines of code.
Get the book on NoStarch or Amazon!
While working as a researcher in distributed systems, Dr. Christian Mayer found his love for teaching computer science students.
To help students reach higher levels of Python success, he founded the programming education website Finxter.com that has taught exponential skills to millions of coders worldwide. He’s the author of the best-selling programming books Python One-Liners (NoStarch 2020), The Art of Clean Code (NoStarch 2022), and The Book of Dash (NoStarch 2022). Chris also coauthored the Coffee Break Python series of self-published books. He’s a computer science enthusiast, freelancer, and owner of one of the top 10 largest Python blogs worldwide.
His passions are writing, reading, and coding. But his greatest passion is to serve aspiring coders through Finxter and help them to boost their skills. You can join his free email academy here.