Forums

404 errors. Flask app. Cannot connect to database.

I get 404 errors when trying to launch my app. Locally everything works. I get nothing in access log, server log and error log.

However I noticed that when launching my app from bash console the app can't connect to heroku postgre database. Don't know if it's the reason.

Here is the error i got: link. Locally it connects.

My wsgi file looks like this:

import sys

path = '/home/siulkilulki/little-hero'
if path not in sys.path:
    sys.path.append(path)

from little_hero_rest_api.app import app as application

My app.py file is here: link

.

I set directories like below:

Source code: /home/siulkilulki/little-hero

Working directory: /home/siulkilulki/little-hero

.

My directory structure looks like this:

directory structure

Does anyone know what to do?

Hi there, free users have restricted Internet access, so that's probably preventing you from accessing an external postgres database hosted on heroku. You're welcome to use our free MySQL service, or to upgrade for unrestricted Internet (and our own postgres service if you like.)