Running the App on the Server
Explore the process of deploying a Dash app by cloning the repository, creating a Python virtual environment, installing dependencies, and running the app on a server. Understand key components like web servers, WSGI middleware, and the Flask framework to successfully run your interactive dashboards in a server environment.
We'll cover the following...
We’ll clone the code and data repository from GitHub, get them to the server, install the dependencies, and try to run the app.
Cloning the application code to the server
We typically have Python already installed on these kinds of servers, but it’s always good to check and know how to get it, just in case it isn’t. An easy way to check if we have it installed, and to get the version in one go, is to run python --version from the command
line. Keep in mind that the python command can be interpreted to mean Python 2. The upgrade to Python 3 took a while to get fully implemented, and so, during that time, to differentiate between the two versions, the python3 command was used to be explicit about wanting to run Python version 3. This applies to the pip command, which can also be run as pip3.
Let’s now activate a virtual environment and clone the GitHub repository, as follows:
- Create a Python virtual environment in a folder called
dash_project(or any other name we want). This will also