当前位置: 首页>>代码示例>>Python>>正文


Python AppConfig.use_ming方法代码示例

本文整理汇总了Python中tg.configuration.AppConfig.use_ming方法的典型用法代码示例。如果您正苦于以下问题:Python AppConfig.use_ming方法的具体用法?Python AppConfig.use_ming怎么用?Python AppConfig.use_ming使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在tg.configuration.AppConfig的用法示例。


在下文中一共展示了AppConfig.use_ming方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_setup_ming_persistance_with_url_alone

# 需要导入模块: from tg.configuration import AppConfig [as 别名]
# 或者: from tg.configuration.AppConfig import use_ming [as 别名]
    def test_setup_ming_persistance_with_url_alone(self):
        if PY3: raise SkipTest()

        package = PackageWithModel()
        conf = AppConfig(minimal=True, root_controller=None)
        conf.package = package
        conf.model = package.model
        conf.use_ming = True
        conf['ming.url'] = 'mim://inmemdb'

        app = conf.make_wsgi_app()
        assert app is not None
开发者ID:Shamefox,项目名称:tg2,代码行数:14,代码来源:test_configuration.py

示例2: test_setup_ming_persistance_advanced_options

# 需要导入模块: from tg.configuration import AppConfig [as 别名]
# 或者: from tg.configuration.AppConfig import use_ming [as 别名]
    def test_setup_ming_persistance_advanced_options(self):
        if PY3: raise SkipTest()

        package = PackageWithModel()
        conf = AppConfig(minimal=True, root_controller=None)
        conf.package = package
        conf.model = package.model
        conf.use_ming = True
        conf['ming.url'] = 'mim://inmemdb'
        conf['ming.connection.read_preference'] = 'PRIMARY'

        app = conf.make_wsgi_app()
        assert app is not None
开发者ID:Shamefox,项目名称:tg2,代码行数:15,代码来源:test_configuration.py

示例3: ApplicationAuthMetadata

# 需要导入模块: from tg.configuration import AppConfig [as 别名]
# 或者: from tg.configuration.AppConfig import use_ming [as 别名]
base_config.package = genfunc

# Enable json in expose
base_config.renderers.append('json')
# Enable genshi in expose to have a lingua franca
# for extensions and pluggable apps.
# You can remove this if you don't plan to use it.
base_config.renderers.append('genshi')

# Set the default renderer
base_config.default_renderer = 'genshi'
# Configure the base Ming Setup
base_config.use_sqlalchemy = False
base_config['tm.enabled'] = False

base_config.use_ming = True
base_config.model = genfunc.model
base_config.DBSession = genfunc.model.DBSession
# Configure the authentication backend
base_config.auth_backend = 'ming'
# YOU MUST CHANGE THIS VALUE IN PRODUCTION TO SECURE YOUR APP
base_config.sa_auth.cookie_secret = "db50d94a-1248-4dba-b571-9de0fdc98af0"
# what is the class you want to use to search for users in the database
base_config.sa_auth.user_class = model.User

from tg.configuration.auth import TGAuthMetadata


# This tells to TurboGears how to retrieve the data for your user
class ApplicationAuthMetadata(TGAuthMetadata):
    def __init__(self, sa_auth):
开发者ID:vzhz,项目名称:function_generator,代码行数:33,代码来源:app_cfg.py

示例4: asbool

# 需要导入模块: from tg.configuration import AppConfig [as 别名]
# 或者: from tg.configuration.AppConfig import use_ming [as 别名]
Please note that **all the argument values are strings**. If you want to
convert them into boolean, for example, you should use the
:func:`paste.deploy.converters.asbool` function, as in::
    
    from paste.deploy.converters import asbool
    setting = asbool(global_conf.get('the_setting'))
 
"""

from tg.configuration import AppConfig

import tg2raptorized
from tg2raptorized import model
from tg2raptorized.lib import app_globals, helpers 

base_config = AppConfig()
base_config.renderers = []

base_config.package = tg2raptorized

#Enable json in expose
base_config.renderers.append('json')
#Set the default renderer
base_config.default_renderer = 'mako'
base_config.renderers.append('mako')
base_config.use_sqlalchemy=False
base_config.use_ming=False
base_config.use_transaction_manager=False
base_config.auth_backend=None
base_config.use_toscawidgets=False
开发者ID:dplepage,项目名称:raptorizemw,代码行数:32,代码来源:app_cfg.py


注:本文中的tg.configuration.AppConfig.use_ming方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。