I've done all the 3 steps you mentioned.
My application works fine except the error I get during paster setup-app
command.
After further digging, I've found the source of error.
in the schema.py file in websetup directory:
-----------
# <websetup.websetup.schema.after.metadata.create_all>
transaction.commit()
from migrate.versioning.shell import main
from migrate.exceptions import DatabaseAlreadyControlledError
try:
main(argv=['version_control'], url=config['sqlalchemy.url'],
repository='migration', name='migration')
except DatabaseAlreadyControlledError:
print 'Database already under version control'
---------
it looks for 'sqlalchemy.url'. I've changed it to 'sqlalchemy.first.url'
and my problem solved.
On 03-02-2012 15:39, alonn wrote:
yes, this document is outdated. better follow this tutorial :
http://www.blog.pythonlibrary.org/2009/06/13/using-multiple-databases-in-turbogears-2/
basic steps:
1. adding first and second sql urls to the dev.ini file
2. changing model.__ini__.py adding another DBSession (naming it
DBSession2 secondSession or wthever), a new metadata object,changing
init_model to use 2 engine ,dbsessions,metadata etc
3.changing app_cfg.py according to the tutorial
good luck and return here if you have specific questions
On 2 פברואר, 15:42, Timuçin Kızılay<[email protected]> wrote:
I'm trying to use a second legacy database with my application.
I've tried to follow documentation on this
link:http://turbogears.org/2.1/docs/main/MultipleDatabases.html#using-mult...
I think that document is old, at the en of that document, there are
instructions to modify myapp/websetup.py but there is no websetup.py in
tg2, websetup is different, so I'm stuck there.
is there a complete example project or tutorial that I can follow?
here is the output of paster setup-app command:
-------------------
Traceback (most recent call last):
File "/home/tkizilay/tg2env/bin/paster", line 9, in<module>
load_entry_point('PasteScript==1.7.4.2', 'console_scripts', 'paster')()
File
"/home/tkizilay/tg2env/lib/python2.7/site-packages/PasteScript-1.7.4.2-py2.7.egg/paste/script/command.py",
line 104, in run
invoke(command, command_name, options, args[1:])
File
"/home/tkizilay/tg2env/lib/python2.7/site-packages/PasteScript-1.7.4.2-py2.7.egg/paste/script/command.py",
line 143, in invoke
exit_code = runner.run(args)
File
"/home/tkizilay/tg2env/lib/python2.7/site-packages/PasteScript-1.7.4.2-py2.7.egg/paste/script/appinstall.py",
line 68, in run
return super(AbstractInstallCommand, self).run(new_args)
File
"/home/tkizilay/tg2env/lib/python2.7/site-packages/PasteScript-1.7.4.2-py2.7.egg/paste/script/command.py",
line 238, in run
result = self.command()
File
"/home/tkizilay/tg2env/lib/python2.7/site-packages/PasteScript-1.7.4.2-py2.7.egg/paste/script/appinstall.py",
line 456, in command
self, config_file, section, self.sysconfig_install_vars(installer))
File
"/home/tkizilay/tg2env/lib/python2.7/site-packages/PasteScript-1.7.4.2-py2.7.egg/paste/script/appinstall.py",
line 598, in setup_config
mod.setup_app, command, filename, section, vars)
File
"/home/tkizilay/tg2env/lib/python2.7/site-packages/PasteScript-1.7.4.2-py2.7.egg/paste/script/appinstall.py",
line 614, in _call_setup_app
func(command, conf, vars)
File "/home/tkizilay/tg2env/intranet/intranet/websetup/__init__.py",
line 18, in setup_app
setup_schema(command, conf, vars)
File "/home/tkizilay/tg2env/intranet/intranet/websetup/schema.py",
line 29, in setup_schema
main(argv=['version_control'], url=config['sqlalchemy.url'],
repository='migration', name='migration')
File
"/home/tkizilay/tg2env/lib/python2.7/site-packages/TurboGears2-2.1.4-py2.7.egg/tg/configuration.py",
line 59, in __getitem__
return self.config_proxy.current_conf()[key]
KeyError: 'sqlalchemy.url'
--
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en.