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


Python AppConfig.default_renderer方法代码示例

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


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

示例1: setup

# 需要导入模块: from tg.configuration import AppConfig [as 别名]
# 或者: from tg.configuration.AppConfig import default_renderer [as 别名]
 def setup(self):
     conf = AppConfig(minimal=True, root_controller=i18nRootController())
     conf['paths']['root'] = 'tests'
     conf['i18n_enabled'] = True
     conf['use_sessions'] = True
     conf['beaker.session.key'] = 'tg_test_session'
     conf['beaker.session.secret'] = 'this-is-some-secret'
     conf.renderers = ['json']
     conf.default_renderer = 'json'
     conf.package = _FakePackage()
     app = conf.make_wsgi_app()
     self.app = TestApp(app)
开发者ID:Cito,项目名称:tg2,代码行数:14,代码来源:test_i18n.py

示例2: AppConfig

# 需要导入模块: from tg.configuration import AppConfig [as 别名]
# 或者: from tg.configuration.AppConfig import default_renderer [as 别名]
 
"""

from tg.configuration import AppConfig

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

base_config = AppConfig()
base_config.renderers = []

base_config.package = wsginiu

#Set the default renderer
base_config.default_renderer = 'genshi'
base_config.renderers.append('genshi')
# if you want raw speed and have installed chameleon.genshi
# you should try to use this renderer instead.
# warning: for the moment chameleon does not handle i18n translations
#base_config.renderers.append('chameleon_genshi')
#Configure the base SQLALchemy Setup
base_config.use_sqlalchemy = True
base_config.model = wsginiu.model
base_config.DBSession = wsginiu.model.DBSession

# YOU MUST CHANGE THIS VALUE IN PRODUCTION TO SECURE YOUR APP
base_config.sa_auth.cookie_secret = "ChangeME"

# Configure the authentication backend
base_config.auth_backend = 'sqlalchemy'
开发者ID:mengt,项目名称:ext2_swfuploadpanel,代码行数:33,代码来源:app_cfg.py

示例3: asbool

# 需要导入模块: from tg.configuration import AppConfig [as 别名]
# 或者: from tg.configuration.AppConfig import default_renderer [as 别名]
    
    from paste.deploy.converters import asbool
    setting = asbool(global_conf.get('the_setting'))
 
"""

from tg.configuration import AppConfig

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

base_config = AppConfig()
base_config.renderers = []

base_config.package = outages

#Enable json in expose
base_config.renderers.append('json')
#Set the default renderer
base_config.default_renderer = 'mako'
base_config.renderers.append('mako')
#Configure the base SQLALchemy Setup
base_config.use_sqlalchemy = True
base_config.model = outages.model
base_config.DBSession = outages.model.DBSession


base_config.use_toscawidgets = False
base_config.use_toscawidgets2 = True
开发者ID:gregjurman,项目名称:outages-moksha,代码行数:32,代码来源:app_cfg.py

示例4: AppConfig

# 需要导入模块: from tg.configuration import AppConfig [as 别名]
# 或者: from tg.configuration.AppConfig import default_renderer [as 别名]
from tg.configuration import AppConfig

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

# from spam.lib.notifications import notify

base_config = AppConfig()
base_config.renderers = []

base_config.package = spam

# Set the default renderer
base_config.default_renderer = "mako"
base_config.renderers.append("mako")
base_config.renderers.append("json")
# if you want raw speed and have installed chameleon.genshi
# you should try to use this renderer instead.
# warning: for the moment chameleon does not handle i18n translations
# base_config.renderers.append('chameleon_genshi')

# Configure the base SQLALchemy Setup
base_config.use_sqlalchemy = True
base_config.model = spam.model
base_config.DBSession = spam.model.DBSession


# YOU MUST CHANGE THIS VALUE IN PRODUCTION TO SECURE YOUR APP
base_config.sa_auth.cookie_secret = "ChangeME"
开发者ID:MrPetru,项目名称:spam,代码行数:32,代码来源:app_cfg.py

示例5: AppConfig

# 需要导入模块: from tg.configuration import AppConfig [as 别名]
# 或者: from tg.configuration.AppConfig import default_renderer [as 别名]
 
"""

from tg.configuration import AppConfig

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

base_config = AppConfig()
base_config.renderers = []
base_config.prefer_toscawidgets2 = True

base_config.package = tghello

#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 = 'jinja'
base_config.renderers.append('jinja')
base_config.jinja_extensions = ['jinja2.ext.with_']
#Configure the base Ming Setup
base_config.use_ming = True
base_config.use_sqlalchemy=False
base_config.use_transaction_manager=False
开发者ID:42cc,项目名称:tg-hello,代码行数:32,代码来源:app_cfg.py

示例6: AppConfig

# 需要导入模块: from tg.configuration import AppConfig [as 别名]
# 或者: from tg.configuration.AppConfig import default_renderer [as 别名]
from tg.configuration import AppConfig

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


base_config = AppConfig()
base_config.renderers = []

base_config.package = skylines

# Enable json in expose
base_config.renderers.append("json")
# Set the default renderer
base_config.default_renderer = "genshi"
base_config.renderers.append("genshi")
# base_config.renderers.append('mako')
# if you want raw speed and have installed chameleon.genshi
# you should try to use this renderer instead.
# warning: for the moment chameleon does not handle i18n translations
# base_config.renderers.append('chameleon_genshi')
# Configure the base SQLALchemy Setup
base_config.use_sqlalchemy = True
base_config.model = skylines.model
base_config.DBSession = skylines.model.DBSession
# Configure the authentication backend


base_config.auth_backend = "sqlalchemy"
base_config.sa_auth.dbsession = model.DBSession
开发者ID:gabor-konrad,项目名称:Skylines,代码行数:33,代码来源:app_cfg.py

示例7:

# 需要导入模块: from tg.configuration import AppConfig [as 别名]
# 或者: from tg.configuration.AppConfig import default_renderer [as 别名]
# Set to a function to provide custom escaping.
base_config.dispatch_path_translator = True

base_config.prefer_toscawidgets2 = True

base_config.package = jeyzth42

# 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 = "jinja"
base_config.renderers.append("jinja")
base_config.jinja_extensions = ["jinja2.ext.with_"]
# Configure the base Ming Setup
base_config.use_sqlalchemy = False
base_config.use_transaction_manager = False

base_config.use_ming = True
base_config.model = jeyzth42.model
base_config.DBSession = jeyzth42.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 = "ee7240e9-ec48-4f41-b684-74ca205dea28"
# what is the class you want to use to search for users in the database
base_config.sa_auth.user_class = model.User
开发者ID:jeyzth,项目名称:jeyzth42,代码行数:33,代码来源:app_cfg.py

示例8:

# 需要导入模块: from tg.configuration import AppConfig [as 别名]
# 或者: from tg.configuration.AppConfig import default_renderer [as 别名]
base_config.dispatch_path_translator = True

base_config.prefer_toscawidgets2 = True

base_config.package = hollyrosa
base_config.custom_tw2_config['script_name'] = '/hollyrosa' # hollyrosa in production

# 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 = 'kajiki'
# Configure the base SQLALchemy Setup
base_config.use_sqlalchemy = False
base_config.model = None ## authtest.model
base_config.DBSession = None ## authtest.model.DBSession
# Configure the authentication backend
base_config.auth_backend = 'sqlalchemy'
# YOU MUST CHANGE THIS VALUE IN PRODUCTION TO SECURE YOUR APP
base_config.sa_auth.cookie_secret = "5e3d194a-4a6c-4969-9eda-9adfaae78bb4"
# what is the class you want to use to search for users in the database
base_config.sa_auth.user_class = None
base_config['flash.template'] = """<div class="notification is-$status $status" ><strong><p>$message</p></strong></div>"""

from tg.configuration.auth import TGAuthMetadata

开发者ID:asplunden,项目名称:hollyrosa,代码行数:31,代码来源:app_cfg.py


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