source: TI05-delivery/ows_framework/trunk/ows_server/ows_server/config/environment.py @ 2916

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/ows_framework/trunk/ows_server/ows_server/config/environment.py@3015
Revision 2916, 1.1 KB checked in by domlowe, 12 years ago (diff)

copying templates for 1.0

Line 
1import os
2
3import pylons.config
4import webhelpers
5
6from ows_server.config.routing import make_map
7
8def load_environment(global_conf={}, app_conf={}):
9    map = make_map(global_conf, app_conf)
10    # Setup our paths
11    root_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
12    paths = {'root_path': root_path,
13             'controllers': os.path.join(root_path, 'controllers'),
14             'templates': [os.path.join(root_path, path) for path in \
15                           ('components', 'templates')],
16             'static_files': os.path.join(root_path, 'public')
17             }
18   
19    # The following template options are passed to your template engines
20    tmpl_options = {}
21    tmpl_options['myghty.log_errors'] = True
22    tmpl_options['myghty.escapes'] = dict(l=webhelpers.auto_link, s=webhelpers.simple_format)
23   
24    # Add your own template options config options here, note that all config options will override
25    # any Pylons config options
26   
27    # Return our loaded config object
28    return pylons.config.Config(tmpl_options, map, paths)
29
Note: See TracBrowser for help on using the repository browser.