Hello. I'm trying to run a python web page but it doesn't load from the webapp url. Instead it shows "Something went wrong :-( Error code: 502-backend" However, when i run the wsgi from the bash terminal it loads without any problems on localhost.
This is the wsgi.py code that tries to import the main page:
import bottle
import os
import sys
project_home = '/home/RIZ/Project'
if project_home not in sys.path:
sys.path = [project_home] + sys.path
templates_dir = os.path.join(project_home, 'views/')
if templates_dir not in bottle.TEMPLATE_PATH:
bottle.TEMPLATE_PATH.insert(0, templates_dir)
from backend import app
application = app
And this is a snippet from code of the main app I'm trying to load:
from bottle import default_app
from waitress import serve
if __name__ != '__main__': #because == was never true for some reason
app = default_app()
serve(app, listen='127.0.0.1:8000')
Furthermore, there are no errors in error log but the server log contains this before it ends:
2021-09-10 19:06:02 Config file not found.
2021-09-10 19:06:02 VACUUM: unix socket /var/sockets/riz.pythonanywhere.com/socket removed.