Material Dashboard with Bokeh embedded in Flask

Starter pack for Bokeh plots in a Material Design dashboard interacting with Flask.


Please keep in mind that this is only a lightweight example of how Flask can
affect the rendering of the bokeh plot. The change in scale is out of scope.


Before you install Python packages, you must meet a few requirements.

. Make sure you use the desired Python version:

.. code-block:: console

$ python --version
Python 3.7.3

Only Python >=3.6 is supported.

. Make sure that `Pip`_
is installed:

.. code-block:: console

$ pip --version
pip 18.1

. If Pip isn’t installed, you can install it with:

.. code-block:: console

$ sudo apt install python3-venv python3-pip

. Install Pipenv <>_:

.. code-block:: console

$ pip3 install --user pipenv
  Downloading pipenv-2018.7.1-py3-none-any.whl (5.0MB): 5.0MB downloaded
Requirement already satisfied (use --upgrade to upgrade): virtualenv in /usr/lib/python3/dist-packages (from pipenv)
Installing collected packages: pipenv, certifi, pip, setuptools, virtualenv-clone
Successfully installed pipenv certifi pip setuptools virtualenv-clone
Cleaning up...

. Download:

.. code-block:: console

$ curl -O
$ unzip

. Create virtual environment:

.. code-block:: console

$ cd flask-bokeh-dashboard
$ pipenv install
Creating a virtualenv for this project…
Updated Pipfile.lock 

Installing dependencies from Pipfile.lock Updated Pipfile.lock (f042ee)…

. Run the dashboard with the `gunicorn`_ command:

.. code-block:: console

$ pipenv run gunicorn -w 1 main:app
[2019-08-21 10:14:54 +0200] [3750] [INFO] Starting gunicorn 19.9.0
[2019-08-21 10:14:54 +0200] [3750] [INFO] Listening at: (3750)
[2019-08-21 10:14:54 +0200] [3750] [INFO] Using worker: sync
[2019-08-21 10:14:54 +0200] [3757] [INFO] Booting worker with pid: 3757

.. note::
The w option can be used to specify the number of workers.

. Visit and it should look like the screenshot above.

. You can shut down the service in the console with ctrl-c.

Pull requests

If you have differences in your preferred setup, I encourage you to fork this
to create your own version. I also accept pull requests on this, if they’re
small, atomic, and if they make my own packaging experience better.


The package provides a starter pack with an interactive Bokeh plot embedded in a Material Design Dashboard, which can send parameters from a flask form to Bokeh.