In case anyone is interested, here is how you can do it:
import sys
import os
import sqlalchemy as sa
from paste.deploy import appconfig, config, CONFIG
from myproject.config.environment import load_environment
config_file = sys.argv[1] #development.ini for example
#script needs to be in the same directory as the ini file for this
line to work.
here_dir = os.path.dirname(os.path.abspath(__file__))
conf = appconfig('config:' + config_file, relative_to=here_dir)
load_environment(conf.global_conf, conf.local_conf)
import myproject.model as model
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" 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/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---