🚀 Gen 5 of the leading AI app deployment platform launches October 6. Click for the livestream.

Deploy Dash on apache server [solved!]

@gerrit - I just ran your example:

# -*- coding: utf-8 -*-
import dash
import dash_core_components as dcc
import dash_html_components as html
import plotly.graph_objs as go
import csv
from datetime import datetime as dt

app = dash.Dash(__name__)
    #'url_base_pathname': '/showtemperature1/',
    # as the proxy server will remove the prefix
    'routes_pathname_prefix': '/showtemperature2/',

    # the front-end will prefix this string to the requests
    # that are made to the proxy server
    'requests_pathname_prefix': '/pompidom3/'
server = app.server

app.layout = html.Div([])

if __name__ == '__main__':

Visiting http://localhost:8050 results in:

(vv) ~/Repos/dash-stuff/dash-sandbox (master)
♡♡ python dash-routes-config.py
 * Running on (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 150-080-314 - - [12/Sep/2017 17:06:40] "GET / HTTP/1.1" 200 - - - [12/Sep/2017 17:06:41] "GET /pompidom3/_dash-layout HTTP/1.1" 200 - - - [12/Sep/2017 17:06:41] "GET /pompidom3/_dash-dependencies HTTP/1.1" 200 -


$ pip freeze | grep dash

I copied your code, I had to make one adjustment, as I run dash on a raspberry pi without windowing system I had to put in host=‘’:

if __name__ == '__main__':
    app.run_server(debug=True, host='') 

resulting in:

pi@rpizolder ~/bin $ python testdash.py 
 * Running on
 * Restarting with reloader - - [13/Sep/2017 20:59:45] "GET / HTTP/1.1" 200 - - - [13/Sep/2017 20:59:45] "GET /_dash-layout HTTP/1.1" 200 - - - [13/Sep/2017 20:59:45] "GET /_dash-dependencies HTTP/1.1" 200 - - - [13/Sep/2017 20:59:45] "GET /_dash-routes HTTP/1.1" 200 -


$ pip freeze | grep dash

What is the difference with or without setting ‘routes_pathname_prefix’ to ‘/showtemperature2/’ here in this example?

Problem found, python 2.7 and 3 were mixed up.
pip freeze was referring to python3 while I was using 2.7 for running the script.

sudo easy_install-2.7 -U pip

and upgrading the components using python 2.7, made my day.

Thanks chris for your effort.


Thought I’d update this thread since the solutions above didn’t work for me. I think the config system changed to be constructor based somewhere along the way. I’m on dash-0.40.0 now.

The below worked for me to host my dash app off a url-prefix.

In app.py:

app = dash.Dash(__name__, external_stylesheets=external_stylesheets, routes_pathname_prefix='/blarg/')

You saved my day!!! Thanks

Those workaround doesn’t work for dash=1.14.0. Could you provide solution for this version?