source: DPPP/ukcip02_server/trunk/ukcip_server/ukcip_server/config/environment.py @ 3486

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/DPPP/ukcip02_server/trunk/ukcip_server/ukcip_server/config/environment.py@3486
Revision 3486, 1.1 KB checked in by spascoe, 12 years ago (diff)

Capabilities almost done

Line 
1"""Pylons environment configuration"""
2import os
3
4from pylons import config
5
6import ukcip_server.lib.app_globals as app_globals
7import ukcip_server.lib.helpers
8from ukcip_server.config.routing import make_map
9
10def load_environment(global_conf, app_conf):
11    """Configure the Pylons environment via the ``pylons.config``
12    object
13    """
14    # Pylons paths
15    root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
16    paths = dict(root=root,
17                 controllers=os.path.join(root, 'controllers'),
18                 static_files=os.path.join(root, 'public'),
19                 templates=[os.path.join(root, 'templates')])
20
21    # Initialize config with the basic options
22    config.init_app(global_conf, app_conf, package='ukcip_server',
23                    template_engine='kid', paths=paths)
24
25    config['routes.map'] = make_map()
26    config['pylons.g'] = app_globals.Globals()
27    config['pylons.h'] = ukcip_server.lib.helpers
28
29    # Customize templating options via this variable
30    tmpl_options = config['buffet.template_options']
31
32    # CONFIGURATION OPTIONS HERE (note: all config options will override
33    # any Pylons config options)
34
Note: See TracBrowser for help on using the repository browser.