New documentation contains more than I expected. Thank You very much! воскресенье, 16 апреля 2017 г., 1:23:55 UTC+3 пользователь Alessandro Molina написал: > > The development branch of documentation should cover all the required > changes for multiple databases support: > http://turbogears.readthedocs.io/en/development/cookbook/multiple-databases.html#using-multiple-databases-in-turbogears > > On Fri, Apr 14, 2017 at 5:13 PM, Alessandro Molina <alessand...@gmail.com > <javascript:>> wrote: > >> The documentation in that paragraph it's in "rough" state and depends >> heavily on TG internals, so it's something that can break easily on any new >> release and it's allowed "at your own risk". I promise I'll update that >> paragraph to make it work with TG2.3 during the weekend so you can check >> that your changes match with the required ones. >> >> On Fri, Apr 14, 2017 at 1:42 PM, Max Snow <maxim.o...@gmail.com >> <javascript:>> wrote: >> >>> Hi. >>> I tried to reproduce example shown here: >>> http://turbogears.readthedocs.io/en/latest/cookbook/multiple-databases.html#using-multiple-databases-in-turbogears >>> I 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. >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "TurboGears" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to turbogears+...@googlegroups.com <javascript:>. >>> To post to this group, send email to turbo...@googlegroups.com >>> <javascript:>. >>> Visit this group at https://groups.google.com/group/turbogears. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> >
-- You received this message because you are subscribed to the Google Groups "TurboGears" group. To unsubscribe from this group and stop receiving emails from it, send an email to turbogears+unsubscr...@googlegroups.com. To post to this group, send email to turbogears@googlegroups.com. Visit this group at https://groups.google.com/group/turbogears. For more options, visit https://groups.google.com/d/optout.