本文整理汇总了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)
示例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'
示例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
示例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"
示例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
示例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
示例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
示例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