Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

vigiboard / vigiboard / config / app_cfg.py @ 57f7cb3f

History | View | Annotate | Download (2.05 KB)

1
# -*- coding: utf-8 -*-
2
"""
3
Global configuration file for TG2-specific settings in vigiboard.
4

5
This file complements development/deployment.ini.
6

7
Please note that **all the argument values are strings**. If you want to
8
convert them into boolean, for example, you should use the
9
:func:`paste.deploy.converters.asbool` function, as in::
10
    
11
    from paste.deploy.converters import asbool
12
    setting = asbool(global_conf.get('the_setting'))
13
 
14
"""
15

    
16
from tg.configuration import AppConfig
17

    
18
import vigiboard
19
from vigiboard import model
20
from vigiboard.lib import app_globals, helpers 
21

    
22
base_config = AppConfig()
23
base_config.renderers = []
24

    
25
base_config.package = vigiboard
26

    
27
#Set the default renderer
28
base_config.default_renderer = 'genshi'
29
base_config.renderers.append('genshi')
30
# if you want raw speed and have installed chameleon.genshi
31
# you should try to use this renderer instead.
32
# warning: for the moment chameleon does not handle i18n translations
33
#base_config.renderers.append('chameleon_genshi')
34

    
35
#Configure the base SQLALchemy Setup
36
base_config.use_sqlalchemy = True
37
base_config.model = vigiboard.model
38
base_config.DBSession = vigiboard.model.DBSession
39

    
40
# Configure the authentication backend
41
base_config.auth_backend = 'sqlalchemy'
42
base_config.sa_auth.dbsession = model.DBSession
43
# what is the class you want to use to search for users in the database
44
base_config.sa_auth.user_class = model.User
45
# what is the class you want to use to search for groups in the database
46
base_config.sa_auth.group_class = model.Group
47
# what is the class you want to use to search for permissions in the database
48
base_config.sa_auth.permission_class = model.Permission
49

    
50
# override this if you would like to provide a different who plugin for
51
# managing login and logout of your application
52
base_config.sa_auth.form_plugin = None
53

    
54
# You may optionally define a page where you want users to be redirected to
55
# on login:
56
base_config.sa_auth.post_login_url = '/post_login'
57

    
58
# You may optionally define a page where you want users to be redirected to
59
# on logout:
60
base_config.sa_auth.post_logout_url = '/post_logout'