PylonsHQ.

Layout: Fixed-width

Troubleshooting SQLAlchemy

Skip to end of metadata
Go to start of metadata

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"

Labels

sqlalchemy sqlalchemy Delete
sacontext sacontext Delete
websetup websetup Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

Powered by Pylons - Contact Administrators