Forums

Dash Dashboard WebApp not loading - Error code: 502-backend (old solution does not work)

Hi guys,

I am trying to load a Dash Dashboard as a WebApp. I have tried many things, but nothing seems to work. Offline the dashboard it works fine.

I followed the instructions I found here:

PythonAnywhere

GitHub

=> Installed all required packages in a virtual environment => Created a web app (manual configuration) => Setting the Source Code to my file: /home/alexjeser/finss.py => Adjust the WSGI File: /var/www/alexjeser_pythonanywhere_com_wsgi.py as shown in the example:

 import sys

project_home = u'/home/alexjeser/'
if project_home not in sys.path:
    sys.path = [project_home] + sys.path

from finss import app
application = app.server

=> Set the Virtualenv to the right path: /home/alexjeser/.virtualenvs/pyer => I hit refresh: Either it is not loading at all or I get the following error:

Error code: 502-backend

The error logs show nothing! Please help :((

Additional Info what could be wrong: I am loading data into the Dashboard from various sources, namely Google Analytics, Google Search Console and Google Sheets. For these I need different API Keys, which I have stored in my /home/alexjeser/ - directory as JSON files. The code is accessing them in order to access the data. I don't know whether this is the issue. But at this point I have no clue, as I thought that I set everything up right.

PS: When I run the file as normal script in Pythonanywhere it runs through without any errors and behaves as expected.

502 usually means that your web app is either taking a long time to return a response or that your web app is just not starting up properly. We have a help page that can help you diagnose the problem: http://help.pythonanywhere.com/pages/502BadGateway/