예제 #1
0
파일: __init__.py 프로젝트: zhaiwei/project
import bbs.apps
from werkzeug.wsgi import SharedDataMiddleware, DispatcherMiddleware

from bbs.register import register_app
from bbs.conf import get_conf

conf = get_conf('bbs')

apps = register_app(bbs.apps)

front_app, dispatch_apps = conf.get('Dispatcher').popitem()

front_app = apps.get(front_app)

dispatch_apps = {v: apps[k] for k, v in dispatch_apps.items()}

app = DispatcherMiddleware(front_app, dispatch_apps)
app = SharedDataMiddleware(app, conf.get('SharedData'))
예제 #2
0
파일: __init__.py 프로젝트: zhaiwei/project
import bbs.apps

from werkzeug.wsgi import DispatcherMiddleware, SharedDataMiddleware

from .registers import register_apps
from .conf import get_conf

conf = get_conf(__name__)

apps = register_apps(bbs.apps)

front_app_name, backend_apps = conf.get('DISPATCH').popitem()
front_app = apps.get(front_app_name)
backend_apps = {v: apps.get(k) for k, v in backend_apps.items()}

app = DispatcherMiddleware(front_app, backend_apps)
app = SharedDataMiddleware(app, conf.get('SHAREDATA'))