Forums

Flask 0.10.1 sqlAlchemy Error

I am having trouble deploying a new app from source. I have configured the wsgi file and running ..wsgi.py does not give me an error. However, when I try to run home.py , my main page, I get:

"Traceback (most recent call last): File "/home/ppyordanov/HCI_4_Future_Cities/src/home.py", line 39, in <module> con = engine.connect() File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1641, in connect return self._connection_cls(self, kwargs) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 59, in init self.connection = connection or engine.raw_connection() File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/base.py", line 1699, in raw_connection return self.pool.unique_connection() File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 220, in unique_connection return _ConnectionFairy(self).checkout() File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 431, in __init rec = self._connection_record = pool._do_get() File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 867, in _do_get return self._create_connection() File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 225, in _create_connection return _ConnectionRecord(self) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 318, in init self.connection = self.__connect() File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/pool.py", line 379, in __connect connection = self.__pool._creator() File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/strategies.py", line 80, in connect return dialect.connect(*cargs, cparams) File "/usr/local/lib/python2.7/dist-packages/sqlalchemy/engine/default.py", line 283, in connect return self.dbapi.connect(cargs, *cparams) sqlalchemy.exc.OperationalError: (OperationalError) unable to open database file None None

                                                                                                                                                                          "

All the requirements have been installed. Feel free to edit the code. And _ Error code: Unhandled Exception _ on ppyordanov.pythonanywhere.com . The app works on localhost.

Now I am getting

  • Running on http://127.0.0.1:5000/
  • Restarting with reloader

When I run home.py, but the same output on ppyordanov.pythonanywhere.com

You're probably using a relative path for your database file and the working directory when you're running it is different to the one when the web app is running. Use the full path to the database.