This is for troubleshooting both SQLAlchemy and SAContext.
Inside this troubleshooting guide, please remember that myapp may not necessarily be the name of your project. If you wish to copy and paste these documents (not recommended!), please remember to change myapp to the name of your project.
"KeyError: "no 'sqlalchemy.default.uri' variable in config file""
Occuring when running: paster setup-app myfile.ini
Error may be found in the websetup.py file
Assuming you have configured websetup.py (particularly SQLAlchemy for people in a hurry, prior to the 25th of July), check your file is configured with the following lines in order (regardless of other lines you may have added):
"""Setup the helloworld application"""
from paste.deploy import appconfig
from pylons import config
from myapp.config.environment import load_environment
def setup_config(command, filename, section, vars):
"""Place any commands to setup helloworld here"""
conf = appconfig('config:' + filename)
load_environment(conf.global_conf, conf.local_conf)
from myapp import model
print "Creating tables"
model.sac.metadata.create_all()
print "Successfully setup"