vigiboard / dashboard / config / app_cfg.py @ 805cc54a
History | View | Annotate | Download (2.05 KB)
1 | 805cc54a | Thomas ANDREJAK | # -*- coding: utf-8 -*-
|
---|---|---|---|
2 | """
|
||
3 | Global configuration file for TG2-specific settings in dashboard.
|
||
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 dashboard |
||
19 | from dashboard import model |
||
20 | from dashboard.lib import app_globals, helpers |
||
21 | |||
22 | |||
23 | base_config = AppConfig() |
||
24 | base_config.renderers = [] |
||
25 | |||
26 | base_config.package = dashboard |
||
27 | |||
28 | #Set the default renderer
|
||
29 | base_config.default_renderer = 'genshi'
|
||
30 | base_config.renderers.append('genshi')
|
||
31 | # if you want raw speed and have installed chameleon.genshi
|
||
32 | # you should try to use this renderer instead.
|
||
33 | # warning: for the moment chameleon does not handle i18n translations
|
||
34 | #base_config.renderers.append('chameleon_genshi')
|
||
35 | |||
36 | #Configure the base SQLALchemy Setup
|
||
37 | base_config.use_sqlalchemy = True
|
||
38 | base_config.model = dashboard.model |
||
39 | base_config.DBSession = dashboard.model.DBSession |
||
40 | |||
41 | # Configure the authentication backend
|
||
42 | base_config.auth_backend = 'sqlalchemy'
|
||
43 | base_config.sa_auth.dbsession = model.DBSession |
||
44 | # what is the class you want to use to search for users in the database
|
||
45 | base_config.sa_auth.user_class = model.User |
||
46 | # what is the class you want to use to search for groups in the database
|
||
47 | base_config.sa_auth.group_class = model.Group |
||
48 | # what is the class you want to use to search for permissions in the database
|
||
49 | base_config.sa_auth.permission_class = model.Permission |
||
50 | |||
51 | # override this if you would like to provide a different who plugin for
|
||
52 | # managing login and logout of your application
|
||
53 | base_config.sa_auth.form_plugin = None
|
||
54 | |||
55 | # You may optionally define a page where you want users to be redirected to
|
||
56 | # on login:
|
||
57 | base_config.sa_auth.post_login_url = '/post_login'
|
||
58 | |||
59 | # You may optionally define a page where you want users to be redirected to
|
||
60 | # on logout:
|
||
61 | base_config.sa_auth.post_logout_url = '/post_logout' |