Hi. I have a similar issue with Dash not deploying.
The webapp worked locally, once deployed the regular parts of the site are working fine. The Dash module however produces an error in passing the app to flask.
The webapp has three plotly dash apps that have been configured with Django-plotly-Dash, they work locally.
The error log provides the following:
File "/home/TheBoatShed/.virtualenvs/myenv/lib/python3.9/site-packages/dash/dash.py", line 494, in __init__ self.init_app()
File "/home/TheBoatShed/.virtualenvs/myenv/lib/python3.9/site-packages/dash/dash.py", line 558, in init_app
self.server.before_request(self._setup_server)
File "/home/TheBoatShed/.virtualenvs/myenv/lib/python3.9/site-packages/flask/scaffold.py", line 39, in wrapper_func
if self._is_setup_finished():
File "/home/TheBoatShed/.virtualenvs/myenv/lib/python3.9/site-packages/flask/app.py", line 517, in _is_setup_finished
return self.debug and self._got_first_request
File "/home/TheBoatShed/.virtualenvs/myenv/lib/python3.9/site-packages/flask/app.py", line 792, in debug
return self.config["DEBUG"]
KeyError: 'DEBUG
DEBUG is set to False in Settings.py. and the WSGI file has the following
DJANGO
# To use your own django app use code like this:
import os
import sys
path = '/home/TheBoatShed/demo'
if path not in sys.path:
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'demosite.settings'
from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
My assumption is that flask is not reading the debug setting in the settings file. I have tried to add locally in the files however as per the Flask docs this has not worked.
Does anyone have any suggestions I could try.
Thanks
Brendon