Simple cgi programing

I’m new here.

now I’m trying to make my dash app work on http server as cgi.

I made a simple cgi script as a portal.

import cgitb

from wsgiref.handlers import CGIHandler
from myapp import server


when myapp is a flask app, the app “” works.

from flask import Flask
server = Flask(__name__)

def hello_world():
    return "Hello World!"

if __name__ == '__main__':

but, when myapp is dash app, it don’t work.

# -*- cording: utf-8 -*-

import dash
import dash_core_components
import dash_html_components

app = dash.Dash(__name__)
server = app.server
app.config.suppress_callback_exceptions = True
		'routes_pathname_prefix': '',
		'requests_pathname_prefix': ''

app.layout = dash_html_components.Div(
		dash_html_components.H1("Hellow Dash World")

if __name__ == '__main__':

it shows only “Loading…”, and has error “Can’t find variable: DashRenderer”.
the error show missing resource files like “

how can I fix this issue??


I tried this and dash code works.

thank you for your reply, @russellthehippo !!

Did you try it on terminal or console, means not access to http://192.168***/index.cgi??

Did you ever get this fixed?
I did not see your question and went way overboard describing the exact same problem No one has offered an answer yet.
Setting url_base_pathname should fix it, but does not help me.
It seems that dash engineers and users are all using WSGI, but I’m stuck with Apache CGI and I presume you are also.