本文整理匯總了Python中transwarp.web.WSGIApplication.template_engine方法的典型用法代碼示例。如果您正苦於以下問題:Python WSGIApplication.template_engine方法的具體用法?Python WSGIApplication.template_engine怎麽用?Python WSGIApplication.template_engine使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類transwarp.web.WSGIApplication
的用法示例。
在下文中一共展示了WSGIApplication.template_engine方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: WSGIApplication
# 需要導入模塊: from transwarp.web import WSGIApplication [as 別名]
# 或者: from transwarp.web.WSGIApplication import template_engine [as 別名]
A WSGI application entry.
'''
import logging; logging.basicConfig(level=logging.INFO)
import os
from transwarp import db
from transwarp.web import WSGIApplication, Jinja2TemplateEngine
from config import configs
# init db:
db.create_engine(**configs.db)
# init wsgi app:
wsgi = WSGIApplication(os.path.dirname(os.path.abspath(__file__)))
template_engine = Jinja2TemplateEngine(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'templates'))
wsgi.template_engine = template_engine
import urls
wsgi.add_interceptor(urls.user_interceptor)
wsgi.add_interceptor(urls.manage_interceptor)
wsgi.add_module(urls)
if __name__ == '__main__':
wsgi.run(8000)