Forums

Jam.py

Hi,

I would like to launch a web-app based on jam.py but it looks like there some problems in stetting of wsgi file.

I think the problem comes from absolute path of sqlite file, but don't know how solve it.

source code : /home/larsal007/mosaic

working directory : /home/larsal007/mosaic

My wsgi file :

import sys
path = '/home/larsal007/mosaic'
from jam.wsgi import create_application
application = create_application(path)

The error message is as following :

2018-03-25 23:43:39,332: Error running WSGI application
2018-03-25 23:43:39,337: sqlite3.OperationalError: no such table: SYS_TASKS
2018-03-25 23:43:39,337:   File "/var/www/larsal007_pythonanywhere_com_wsgi.py", line 75, in <module>
2018-03-25 23:43:39,337:     application = create_application('/home/larsal007/mosaic/')
2018-03-25 23:43:39,337: 
2018-03-25 23:43:39,338:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/wsgi.py", line 94, in create_application
2018-03-25 23:43:39,338:     application = App(work_dir)
2018-03-25 23:43:39,338: 
2018-03-25 23:43:39,338:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/wsgi.py", line 134, in __init__
2018-03-25 23:43:39,338:     self.admin = self.create_admin()
2018-03-25 23:43:39,338: 
2018-03-25 23:43:39,338:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/wsgi.py", line 137, in create_admin
2018-03-25 23:43:39,338:     return adm_server.create_admin(self)
2018-03-25 23:43:39,338: 
2018-03-25 23:43:39,339:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/adm_server.py", line 688, in create_admin
2018-03-25 23:43:39,339:     update_admin_fields(task)
2018-03-25 23:43:39,339: 
2018-03-25 23:43:39,339:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/adm_server.py", line 649, in update_admin_fields
2018-03-25 23:43:39,339:     check_item_fields(item)
2018-03-25 23:43:39,339: 
2018-03-25 23:43:39,339:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/adm_server.py", line 630, in check_item_fields
2018-03-25 23:43:39,339:     do_updates(con, field, item.item_name)
2018-03-25 23:43:39,339: 
2018-03-25 23:43:39,340:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/adm_server.py", line 523, in do_updates
2018-03-25 23:43:39,340:     db_module = get_db_module(con)
2018-03-25 23:43:39,340: 
2018-03-25 23:43:39,340:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/adm_server.py", line 513, in get_db_module
2018-03-25 23:43:39,340:     cursor.execute('SELECT F_DB_TYPE FROM SYS_TASKS')
2018-03-25 23:43:39,340: ***************************************************
2018-03-25 23:43:39,340: If you're seeing an import error and don't know why,
2018-03-25 23:43:39,340: we have a dedicated help page to help you debug: 
2018-03-25 23:43:39,340: https://help.pythonanywhere.com/pages/DebuggingImportError/
2018-03-25 23:43:39,341: ***************************************************
2018-03-25 23:43:53,233: Error running WSGI application
2018-03-25 23:43:53,233: sqlite3.OperationalError: no such table: SYS_TASKS
2018-03-25 23:43:53,234:   File "/var/www/larsal007_pythonanywhere_com_wsgi.py", line 75, in <module>
2018-03-25 23:43:53,234:     application = create_application('/home/larsal007/mosaic/')
2018-03-25 23:43:53,234: 
2018-03-25 23:43:53,234:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/wsgi.py", line 94, in create_application
2018-03-25 23:43:53,234:     application = App(work_dir)
2018-03-25 23:43:53,235: 
2018-03-25 23:43:53,235:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/wsgi.py", line 134, in __init__
2018-03-25 23:43:53,235:     self.admin = self.create_admin()
2018-03-25 23:43:53,235: 
2018-03-25 23:43:53,235:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/wsgi.py", line 137, in create_admin
2018-03-25 23:43:53,235:     return adm_server.create_admin(self)
2018-03-25 23:43:53,236: 
2018-03-25 23:43:53,236:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/adm_server.py", line 688, in create_admin
2018-03-25 23:43:53,236:     update_admin_fields(task)
2018-03-25 23:43:53,236: 
2018-03-25 23:43:53,236:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/adm_server.py", line 649, in update_admin_fields
2018-03-25 23:43:53,236:     check_item_fields(item)
2018-03-25 23:43:53,236: 
2018-03-25 23:43:53,236:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/adm_server.py", line 630, in check_item_fields
2018-03-25 23:43:53,237:     do_updates(con, field, item.item_name)
2018-03-25 23:43:53,237: 
2018-03-25 23:43:53,237:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/adm_server.py", line 523, in do_updates
2018-03-25 23:43:53,237:     db_module = get_db_module(con)
2018-03-25 23:43:53,237: 
2018-03-25 23:43:53,237:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/adm_server.py", line 513, in get_db_module
2018-03-25 23:43:53,238:     cursor.execute('SELECT F_DB_TYPE FROM SYS_TASKS')
2018-03-25 23:43:53,238: ***************************************************
2018-03-25 23:43:53,238: If you're seeing an import error and don't know why,
2018-03-25 23:43:53,238: we have a dedicated help page to help you debug: 
2018-03-25 23:43:53,238: https://help.pythonanywhere.com/pages/DebuggingImportError/
2018-03-25 23:43:53,239: ***************************************************
2018-03-25 23:58:12,243: Error running WSGI application
2018-03-25 23:58:12,249: sqlite3.OperationalError: no such table: SYS_TASKS
2018-03-25 23:58:12,249:   File "/var/www/larsal007_pythonanywhere_com_wsgi.py", line 75, in <module>
2018-03-25 23:58:12,249:     application = create_application('/home/larsal007/mosaic/')
2018-03-25 23:58:12,249: 
2018-03-25 23:58:12,249:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/wsgi.py", line 94, in create_application
2018-03-25 23:58:12,249:     application = App(work_dir)
2018-03-25 23:58:12,249: 
2018-03-25 23:58:12,250:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/wsgi.py", line 134, in __init__
2018-03-25 23:58:12,250:     self.admin = self.create_admin()
2018-03-25 23:58:12,250: 
2018-03-25 23:58:12,250:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/wsgi.py", line 137, in create_admin
2018-03-25 23:58:12,250:     return adm_server.create_admin(self)
2018-03-25 23:58:12,250: 
2018-03-25 23:58:12,250:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/adm_server.py", line 688, in create_admin
2018-03-25 23:58:12,250:     update_admin_fields(task)
2018-03-25 23:58:12,250: 
2018-03-25 23:58:12,251:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/adm_server.py", line 649, in update_admin_fields
2018-03-25 23:58:12,251:     check_item_fields(item)
2018-03-25 23:58:12,251: 
2018-03-25 23:58:12,251:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/adm_server.py", line 630, in check_item_fields
2018-03-25 23:58:12,251:     do_updates(con, field, item.item_name)
2018-03-25 23:58:12,251: 
2018-03-25 23:58:12,251:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/adm_server.py", line 523, in do_updates
2018-03-25 23:58:12,251:     db_module = get_db_module(con)
2018-03-25 23:58:12,251: 
2018-03-25 23:58:12,251:   File "/home/larsal007/.virtualenvs/jam/lib/python3.5/site-packages/jam/adm_server.py", line 513, in get_db_module
2018-03-25 23:58:12,252:     cursor.execute('SELECT F_DB_TYPE FROM SYS_TASKS')
2018-03-25 23:58:12,252: ***************************************************
2018-03-25 23:58:12,252: If you're seeing an import error and don't know why,
2018-03-25 23:58:12,252: we have a dedicated help page to help you debug: 
2018-03-25 23:58:12,252: https://help.pythonanywhere.com/pages/DebuggingImportError/
2018-03-25 23:58:12,252: ***************************************************

Any advice or help is welcome.

Thanks in advance.

Regards.

Salim Larhrib.

Did you reload the website from the "Web" page after setting the working directory? If not, could you try doing that and see if it helps?

Hello, Thank you for your reply. Yes, I did the website reload from "web" page before asking for any help. It doesn't work. Thank you. Regards.

Since you're using a sqlite database, you need to make sure that you're referring to the database file correctly. See http://help.pythonanywhere.com/pages/NoSuchFileOrDirectory/