Latest Version: 0.9.6.2
  Dashboard > Pylons Cookbook > ... > Troubleshooting > Troubleshooting SQLAlchemy
  Pylons Cookbook Log In | Sign Up   View a printable version of the current page.  
  Troubleshooting SQLAlchemy
Added by Alexander Stanley, last edited by Mike Orr on Aug 15, 2007  (view change)
Labels: 

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"

Site running on a free Atlassian Confluence Open Source Project License granted to Pylons. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.3.3 Build:#645 Feb 13, 2007) - Bug/feature request - Contact Administrators
Top