| 172 |
ashish |
1 |
# -*- coding: utf-8 -*-
|
|
|
2 |
"""WSGI middleware initialization for the Wiki-20 application."""
|
|
|
3 |
|
|
|
4 |
from wiki20.config.app_cfg import base_config
|
|
|
5 |
from wiki20.config.environment import load_environment
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
__all__ = ['make_app']
|
|
|
9 |
|
|
|
10 |
# Use base_config to setup the necessary PasteDeploy application factory.
|
|
|
11 |
# make_base_app will wrap the TG2 app with all the middleware it needs.
|
|
|
12 |
make_base_app = base_config.setup_tg_wsgi_app(load_environment)
|
|
|
13 |
|
|
|
14 |
|
|
|
15 |
def make_app(global_conf, full_stack=True, **app_conf):
|
|
|
16 |
"""
|
|
|
17 |
Set Wiki-20 up with the settings found in the PasteDeploy configuration
|
|
|
18 |
file used.
|
|
|
19 |
|
|
|
20 |
:param global_conf: The global settings for Wiki-20 (those
|
|
|
21 |
defined under the ``[DEFAULT]`` section).
|
|
|
22 |
:type global_conf: dict
|
|
|
23 |
:param full_stack: Should the whole TG2 stack be set up?
|
|
|
24 |
:type full_stack: str or bool
|
|
|
25 |
:return: The Wiki-20 application with all the relevant middleware
|
|
|
26 |
loaded.
|
|
|
27 |
|
|
|
28 |
This is the PasteDeploy factory for the Wiki-20 application.
|
|
|
29 |
|
|
|
30 |
``app_conf`` contains all the application-specific settings (those defined
|
|
|
31 |
under ``[app:main]``.
|
|
|
32 |
|
|
|
33 |
|
|
|
34 |
"""
|
|
|
35 |
app = make_base_app(global_conf, full_stack=True, **app_conf)
|
|
|
36 |
|
|
|
37 |
# Wrap your base TurboGears 2 application with custom middleware here
|
|
|
38 |
|
|
|
39 |
return app
|