Is there a way to share common configuration using Paste Deploy?

别等时光非礼了梦想. 提交于 2019-12-06 02:22:05

For example, Kotti thinks I've properly set sqlalchemy.url, but sqlalchemy iteself fails on url = opts.pop('url').

If you think something is odd and you're asking on SO it'd be wise to show a stacktrace and an example of what you tried to do.

Kotti gets its settings the same as any pyramid app. Your entry point (def main(global_conf, **settings) usually) is passed the global_conf and settings dictionary. You're then responsible for fixing that up and shuffling it off into the configurator.

For various reasons PasteDeploy keeps the global_conf separate from the settings, thus you're responsible for merging them if you wish.

[DEFAULT]
foo = bar

[app:main]
use = egg:myapp#main
baz = xyz

def main(global_conf, **app_settings):
    settings = global_conf
    settings.update(app_settings)
    config = Configurator(settings=settings)
    config.include('kotti')
    return config.make_wsgi_app()
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!