Hi.
I tried to reproduce example shown here:
http://turbogears.readthedocs.io/en/latest/cookbook/multiple-databases.html#using-multiple-databases-in-turbogearsI did steps word to word.
After everything done I execute "
gearbox setup-app" and the result is:
----
Traceback (most recent call last):
File "/home/tg2env/site-packages/gearbox/main.py", line 167, in _run_subcommand
return cmd.run(parsed_args)
File "/home/tg2env/site-packages/gearbox/command.py", line 31, in run
self.take_action(parsed_args)
File "/home/tg2env/site-packages/gearbox/commands/setup_app.py", line 53, in take_action
self._setup_config(dist, config_file, section, {}, verbosity=self.app.options.verbose_level)
File "/home/tg2env/site-packages/gearbox/commands/setup_app.py", line 93, in _setup_config
self._call_setup_app(mod.setup_app, filename, section, vars)
File "/home/tg2env/site-packages/gearbox/commands/setup_app.py", line 108, in _call_setup_app
func(None, conf, vars)
File "/home/MyProject/myproj/websetup/__init__.py", line 18, in setup_app
load_environment(conf.global_conf, conf.local_conf)
File "/home/tg2env/site-packages/tg/configuration/app_config.py", line 920, in load_environment
self._setup_persistence(app_config)
File "/home/tg2env/site-packages/tg/configuration/app_config.py", line 688, in _setup_persistence
self._setup_sqlalchemy(conf)
File "/home/tg2env/site-packages/tg/configuration/app_config.py", line 783, in _setup_sqlalchemy
engine = engine_from_config(conf, 'sqlalchemy.')
File "/home/tg2env/site-packages/sqlalchemy/engine/__init__.py", line 427, in engine_from_config
url = options.pop('url')
KeyError: 'url'----
I need 2 databases to split auth and common stuff (to prevent access to users' password hashes).
Some things I did on my own (I'm not sure I was correct):
1) Inside '
myapp/config/app_cfg.py' I used ...
----
class MultiDBAppConfig(AppConfig):
def _setup_sqlalchemy(self, conf):----
... instead of ...
----
class MultiDBAppConfig(AppConfig):
def setup_sqlalchemy(self):----
2) I made changes inside '
myapp/websetup/schema.py => def setup_schema' instead of '
myapp/websetup.py => def setup_app'
If I did something wrong, please let me know.
If I did everything right, could You please correct this part of documentation? Or maybe I read instructions from wrong source?
Best Regards,
Maxim.