KeyError: 'url'

68 views
Skip to first unread message

Rurangwa Moses

unread,
Nov 13, 2014, 6:43:27 AM11/13/14
to pylons-...@googlegroups.com
This is how my error message looks like..... 
  load_entry_point('beatstore==0.0', 'console_scripts', 'initialize_beatstore_db')()
  File "/home/twir/Desktop/Pyramid-Apps/Final/Store/Store/scripts/initializedb.py", line 41, in main
    engine = engine_from_config(settings, 'sqlalchemy.')

Here is my initializedb.py
    options = parse_vars(argv[2:])
    setup_logging(config_uri)
    settings = get_appsettings(config_uri, options=options)
    engine = engine_from_config(settings, 'sqlalchemy.')..........................................................line 41
    DBSession.configure(bind=engine)
    Base.metadata.create_all(engine)

Hope you guys help ASAP..
Thanks
Moses R.

Rurangwa Moses

unread,
Nov 13, 2014, 10:15:06 AM11/13/14
to pylons-...@googlegroups.com
Line 41 shown up is where the error seems to coming from.....

Mike Orr

unread,
Nov 13, 2014, 10:22:15 AM11/13/14
to pylons-...@googlegroups.com
Yes, SQLAlchemy requires a 'sqlalchemy.url' key in the 'settings' dict
when called in the way you did, and the error message is cryptic.
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pylons-discus...@googlegroups.com.
> To post to this group, send email to pylons-...@googlegroups.com.
> Visit this group at http://groups.google.com/group/pylons-discuss.
> For more options, visit https://groups.google.com/d/optout.



--
Mike Orr <slugg...@gmail.com>

Rurangwa Moses

unread,
Nov 13, 2014, 10:28:41 AM11/13/14
to pylons-...@googlegroups.com
Hey Mike, Thanks for your reply but how exactly do i go about this to fully recover from the error???

Michael Merickel

unread,
Nov 13, 2014, 1:57:12 PM11/13/14
to Pylons
The issue is that get_appsettings() will default to the "main" app of
your ini file. In your case you have named your app "music" as
signified by the "[app:music]" section. In this case you must tell
initializedb to look there for the settings.

env/bin/initializedb development.ini#music

Rurangwa Moses

unread,
Nov 14, 2014, 1:06:24 AM11/14/14
to pylons-...@googlegroups.com
Thanks Very much @Michael Merickel it has actually worked very fine.
Reply all
Reply to author
Forward
0 new messages