Forums

Web app query

I'm trying to host a Flask restful server on PythonAnywhere. My code ran fine locally, on python anywhere it had troubles connecting to my original database provider. So, I switched to using PythonAnywhere databases and using the flask template from the tutorial here. The template ran fine, but when I replace it with my code, it doesn't seem to work. The webapp page just displays "Something went wrong".

Where can I access a log of what triggered the error.

my bad. I found the error log myself.

conn = pymysql.connect(host='signals.mysql.pythonanywhere-services.com', user='signals', password='<password>'', db='default', charset='utf8mb4', cursorclass=pymysql.cursors.DictCursor)

This is my connection string.

The error log shows that access is denied. I've double checked my password as well.

Error running WSGI application 2017-12-20 10:16:57,583: OperationalError: (1044, u"Access denied for user 'signals'@'%' to database 'default'") 2017-12-20 10:16:57,583: File "/var/www/signals_pythonanywhere_com_wsgi.py", line 16, in <module> 2017-12-20 10:16:57,583: from my_rest import app as application

the db is probably wrong. It is most likely 'signals$default' instead of default

oops. sorry. my bad again. thanks for pointing out.

:)