Dash#

To deploy a Dash application you need a Ploomber Cloud account and at least two files zipped up:

  1. Your application file (app.py)

  2. A dependencies file (requirements.txt)

Note that the application will run with Python 3.11. Refer to this section for customized deployments. Here is a sample Docker-based Dash application.

Required files#

You can use this template to get started.

In the requirements.txt file, add all the dependencies that you need for your application to run. The application logic should exist in an app.py file and be initialized in this way:

# name your app "app"
app = Dash(__name__)
# add this line below
server = app.server

Testing locally#

To test the Dash application, you can run the following commands locally:

# build the docker image
pip install -r requirements.txt

# Start the dash application
gunicorn app:server run --bind 0.0.0.0:5000

Now, open http://0.0.0.0:5000/ to see your app.

Deploy#

Deploy from the menu

Once you have all your files, create a zip file.

To deploy a Dash app from the deployment menu, select the Dash option and follow the instructions:

Try an example

To download and deploy an example Dash application start by installing Ploomber Cloud and setting your API key:

pip install ploomber-cloud
ploomber-cloud key YOUR-KEY

Tip

If you don’t have an API key yet, follow the instructions here.

Now, download an example. It will prompt you for a location to download the app. To download in the current directory, just press enter.

ploomber-cloud examples dash/clinical-analytics

Note

A full list of Dash example apps is available here.

You should see a confirmation with instructions on deploying your app. Now, navigate to your application:

cd location-you-entered/clinical-analytics

Deploy from the CLI

Initialize and deploy your app with:

ploomber-cloud init
ploomber-cloud deploy --watch

Tip

To ensure your app doesn’t break on re-deployments, pin your dependencies.

Features#

Ploomber Cloud supports many features to help you build Dash applications quickly!

Examples#

Basic app

Clinical analytics