When I try to add a new record to Web2py Database I get this error. I've moved the repository from a different machine but all of my files are same.
My previous database DAL connection parameters are as follow:
from gluon.contrib.appconfig import AppConfig
myconf = AppConfig(reload=True)
if not request.env.web2py_runtime_gae:
db = DAL(myconf.get('db.'+myconf.get('db.mode')+'_uri'),
pool_size=myconf.get('db.pool_size'),
migrate=myconf.get('db.migrate'),
migrate_enabled=myconf.get('db.migrate_enabled'),
#fake_migrate_all=myconf.get('db.fake_migrate_all'),
fake_migrate_all=True,
check_reserved=['all'])
else:
db = DAL('google:datastore+ndb')
session.connect(request, response, db=db)
It was giving me user_auth
not found error so I changed it into this by following the official docs:
from gluon.contrib.appconfig import AppConfig
myconf = AppConfig(reload=True)
if not request.env.web2py_runtime_gae:
db = DAL('sqlite://storage.sqlite', pool_size=1, check_reserved=['all'], migrate=False, fake_migrate_all=True)
else:
db = DAL('google:datastore+ndb')
It shows all the table in /database and in "Database_Administration" console I try to add a new record I get the error below.
Web2py Error" <class 'sqlite3.OperationalError'> no such table: application
There is no table in my app named "application" so it has to be related to app. Please advise.
Go to your database folder in "applications/yourappname/databases". Remove all the tables and then recreate tables. You must had copied it from somewhere and couldn't get all the tables loaded. Set migrate=True and fake_migrate_all=false. Then rerun server and go to your app in web2py server panel. Select "Edit" and go to "database administration" under "Models" on the admin panel. You will get all the tables recreated on your own machine. If this is not the case that you've copied from some other source....still do the following by deleting all the tables. You will surely get it up and running.