Multiple Database Connections With Python + Pylons + Sqlalchemy
I'm trying to implement the proper architecture for multiple databases under Python + Pylons. I can't put everything in the config files since one of the database connections requ
Solution 1:
Pylons's template configures the database in config/environment.py
, probably with the engine_from_config
method. It finds all the config settings with a particular prefix and passes them as keyword arguments to create_engine
.
You can just replace that with a few calls to sqlalchemy.create_engine()
with the per-engine url
, and common username
, and password
from your config file.
Post a Comment for "Multiple Database Connections With Python + Pylons + Sqlalchemy"