Slapdash
Boilerplate for bootstrapping multi-page Dash applications
Note: This is a work in progress, but it's probably at a point where it's more useful than not.
Dash is a Python framework for building analytical web applications. Slapdash provides a template for quickly building out a multi-page Dash application. It includes pre-built layouts based on Bootstrap, which can be extended or swapped out for layouts constructed using your own CSS.
Also included is dash_skeleton.py, a template for bootstrapping smaller
single-file applications.
Usage
- In
app.py, select the main layout you want fromlayouts.py. - Create your callbacks in
callbacks.py. - Create your pages in
pages.py. - Add your pages to the
urlsattribute inrouter.py. - Add desired pages to
NAV_ITEMS(if using a navbar) insettings.py. - Add additional CSS to
static/custom.css. - Modify any additional settings in settings.py as desired. (The only other one you will likely definitely need to change is TITLE).
- Run the app either with
python run_flask.py (--debug)or by targeting a WSGI server atwsgi.py.
Note that this project is intended for bootstrapping initial Dash applications, as opposed to being a library that you import. You probably shouldn't assume that its internal structure and interfaces will be stable, as they will likely change.
Boilerplate Overview
app.pyEntry point into the app. Imports other modules in correct order.server.pyCreates both the Flask server and Dash app instances used for the app.wsgi.pyContainsapplicationattribute suitable for pointing WSGI servers at.settings.pyConfigurable settings for the application.router.pyContains the application routes in url and initialises the router callback.exceptions.pyExceptions used by the app are defined here.layouts.pyPossible values for thelayoutattribute of the Dash instance are defined here.components.pyConvenience pseudo-components defined here, such asRowandColfor an easy experience creating Bootstrap rows and columns..utils.pyUtility things defined here.callbacks.pyCustom callbacks go here.pages.pyCustom pages go here.staticLocation for static assets that will be exposed to the web server.
Included Libraries
Slapdash includes a few plugins for getting fully functional applications off the ground faster. These currently include:
- Bootstrap v4 Just the CSS, primarily for its grid layout.
- Font Awesome Because everyone wants pretty icons.
dash_skeleton.py
For simple applications that with a single view, the full Slapdash codebase is
probably overkill. dash_skeleton.py is a Dash single-file Dash template that
you can pull down and start hacking on with minimal overhead.
Useful References
-
Plotly Python client figure reference Documents the contents of plotly.graph_objs, which contains the different types of charts available, as well the Layout class, for customising the appearance of charts.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
