author | Adrien Di Mascio <Adrien.DiMascio@logilab.fr> |
Thu, 21 May 2009 23:59:36 +0200 | |
changeset 1893 | 80715c23bacf |
parent 1802 | d628defebc17 |
child 1977 | 606923dff11b |
permissions | -rw-r--r-- |
0 | 1 |
if __name__ == '__main__': |
2 |
||
3 |
from os.path import dirname, abspath |
|
4 |
from cubicweb import goa |
|
5 |
from cubicweb.goa.goaconfig import GAEConfiguration |
|
6 |
from cubicweb.goa.dbinit import create_user, create_groups |
|
1802
d628defebc17
delete-trailing-whitespace + some copyright update
Adrien Di Mascio <Adrien.DiMascio@logilab.fr>
parents:
0
diff
changeset
|
7 |
|
0 | 8 |
# compute application's root directory |
9 |
APPLROOT = dirname(abspath(__file__)) |
|
10 |
# apply monkey patches first |
|
11 |
goa.do_monkey_patch() |
|
12 |
# get application's configuration (will be loaded from app.conf file) |
|
13 |
GAEConfiguration.ext_resources['JAVASCRIPTS'].append('DATADIR/goa.js') |
|
14 |
config = GAEConfiguration('toto', APPLROOT) |
|
15 |
# create default groups |
|
16 |
create_groups() |
|
17 |
if not config['use-google-auth']: |
|
18 |
# create default admin |
|
19 |
create_user('admin', 'admin', ('managers', 'users')) |
|
20 |
# create anonymous user if specified |
|
21 |
anonlogin = config['anonymous-user'] |
|
22 |
if anonlogin: |
|
23 |
create_user(anonlogin, config['anonymous-password'], ('guests',)) |
|
24 |
print 'content initialized' |