#!/usr/bin/env python # -*- coding: utf-8 -*- import os from jinja2 import Environment, FileSystemLoader from jinja2 import MemcachedBytecodeCache import setting from lib.util import setting_from_object from lib.database import Db from lib import uimodules import memcache settings = setting_from_object(setting) settings.update({ 'template_path':os.path.join(os.path.dirname(__file__), 'template'), 'static_path':os.path.join(os.path.dirname(__file__), 'style'), 'upload_path':os.path.join(os.path.dirname(__file__), 'upload'), 'cookie_secret':"SZUzonpBQIuXE3yKBtWPre2N5AS7jEQKv0Kioj9iKT0=", 'login_url':'/signin', "xsrf_cookies": True, 'ui_modules' : uimodules, 'autoescape':None }) memcachedb = memcache.Client([settings['memcache_host']]) bcc = None if settings['debug'] == False: bcc = MemcachedBytecodeCache(memcachedb)
#!/usr/bin/env python #coding=utf8 import os from jinja2 import Environment, FileSystemLoader from jinja2 import MemcachedBytecodeCache import setting from lib.util import setting_from_object from lib.database import Db from lib import uimodules import memcache settings = setting_from_object(setting) # 在bootloader中将settings.py中的配置转换成一个dict,供manager.py使用 settings.update({ 'template_path':os.path.join(os.path.dirname(__file__), 'template'), 'static_path':os.path.join(os.path.dirname(__file__), 'style'), 'upload_path':os.path.join(os.path.dirname(__file__), 'upload'), 'cookie_secret':"SZUzonpBQIuXE3yKBtWPre2N5AS7jEQKv0Kioj9iKT0=", 'login_url':'/signin', "xsrf_cookies": True, 'ui_modules' : uimodules, 'autoescape':None }) memcachedb = memcache.Client([settings['memcache_host']]) bcc = None if settings['debug'] == False: bcc = MemcachedBytecodeCache(memcachedb)
# -*- coding: utf-8 -*- import os from jinja2 import Environment, FileSystemLoader from jinja2 import MemcachedBytecodeCache import setting from lib.util import setting_from_object from lib.database import Db from lib import uimodules import memcache settings = setting_from_object(setting) settings.update({ 'template_path': os.path.join(os.path.dirname(__file__), 'template'), 'static_path': os.path.join(os.path.dirname(__file__), 'style'), 'upload_path': os.path.join(os.path.dirname(__file__), 'upload'), 'cookie_secret': "SZUzonpBQIuXE3yKBtWPre2N5AS7jEQKv0Kioj9iKT0=", 'login_url': '/signin', "xsrf_cookies": True, 'ui_modules': uimodules, 'autoescape': None })
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2014-06-19 23:28:16 # @Author : shitao.tommy ([email protected]) # @Link : http://example.org # @Version : $Id$ import settings import os from lib import util from lib import common_uimodule from importlib import import_module from lib import log settings = util.setting_from_object(settings) uimodules = [] uimodules.append(common_uimodule) # set uimodules for i in os.listdir('web/uiwidget'): if i.endswith('.py') and i != '__init__.py': module = import_module('.%s' % i[:-3], 'web.uiwidget') uimodules.append(module) settings.update({ 'template_path':os.path.join(os.path.dirname(__file__), 'web/template'), 'static_path':os.path.join(os.path.dirname(__file__), 'static'), 'upload_path':os.path.join(os.path.dirname(__file__), 'static/upload'), 'cookie_secret':"x1g5zGibQISFc0+t2G2qcwraupWIKEt2ibwCmQgSfcU=",