Blame view

resources/db_config.py 1.98 KB
b4ff40eb   hitier   More comments in ...
1
2
3
4
5
6
# Here are the databases configuration models for the main database engines:
# sqlite, mysql, postgresql
#
# Edit the one you need, then set proper variable at the end of the file.
#

d086fdc1   hitier   Main config file ...
7
SQLITE = {
b4ff40eb   hitier   More comments in ...
8
    'file': '/path/to/directory/pdc.db'
d086fdc1   hitier   Main config file ...
9
10
11
12
13
14
}
sqlite_uri = 'sqlite:///%(file)s' % SQLITE

MYSQL = {
    'user': 'mysql',
    'pw': 'mysql',
b4ff40eb   hitier   More comments in ...
15
    'db': 'pdc_db',
d086fdc1   hitier   Main config file ...
16
17
18
19
20
    'host': '127.0.0.1',
    'port': '3306',
}
mysql_uri = 'mysql+pymysql://%(user)s:%(pw)s@%(host)s:%(port)s/%(db)s' % MYSQL

2784d9cc   hitier   Add models for ch...
21
POSTGRES = {
b4ff40eb   hitier   More comments in ...
22
23
24
    'user': 'pdc-user',
    'pw': 'pdc-pwd',
    'db': 'pdc-db',
2784d9cc   hitier   Add models for ch...
25
    'host': '127.0.0.1',
d086fdc1   hitier   Main config file ...
26
    'port': '5432',
2784d9cc   hitier   Add models for ch...
27
28
29
}
postgres_uri = 'postgresql://%(user)s:%(pw)s@%(host)s:%(port)s/%(db)s' % POSTGRES

b4ff40eb   hitier   More comments in ...
30
31
32
# If needed, use other databases depending on the development phase you are on:
# testing, dev, or production: see below for the proper var to set.
#
d086fdc1   hitier   Main config file ...
33
POSTGRESTEST = {
b4ff40eb   hitier   More comments in ...
34
35
36
    'user': 'pdctest-user',
    'pw': 'pdctest-pwd',
    'db': 'pdctest-test-db',
d086fdc1   hitier   Main config file ...
37
38
39
40
    'host': '127.0.0.1',
    'port': '5434',
}
postgres_test_uri = 'postgresql://%(user)s:%(pw)s@%(host)s:%(port)s/%(db)s' % POSTGRESTEST
2784d9cc   hitier   Add models for ch...
41

21724174   hitier   Fix mysql_lesia_u...
42
# The lesia mysql agents database
b4ff40eb   hitier   More comments in ...
43
44
# It is possible to connect to a lesia like mysql db.
#  set it here
d086fdc1   hitier   Main config file ...
45
MYSQL_LESIA = {
2784d9cc   hitier   Add models for ch...
46
47
    'user': 'mysql',
    'pw': 'mysql',
b4ff40eb   hitier   More comments in ...
48
    'db': 'lesia_db',
2784d9cc   hitier   Add models for ch...
49
50
51
    'host': '127.0.0.1',
    'port': '3306',
}
b7839ec6   hitier   Show db connexion...
52
mysql_lesia_uri = 'mysql+pymysql://%(user)s:%(pw)s@%(host)s:%(port)s/%(db)s' % MYSQL_LESIA
d086fdc1   hitier   Main config file ...
53

b4ff40eb   hitier   More comments in ...
54
55
56
57
# To set you databases uri,
# uncomment the needed lines to fit your specific needs;
# they will be imported in ./pdc_config.py
# ( remember to edit the corresponding database setting above )
d086fdc1   hitier   Main config file ...
58
#
b4ff40eb   hitier   More comments in ...
59
60
61
62
63
64

# The main database for a production site:
# ( defaults to an sqlite db file )
#
# sqlalchemy_database_uri = mysql_uri
# sqlalchemy_database_uri = sqlite_uri
d086fdc1   hitier   Main config file ...
65
# sqlalchemy_database_uri = postgres_uri
b4ff40eb   hitier   More comments in ...
66
67
68
69

# The development database:
# ( defaults to an sqlite db file )
#
d086fdc1   hitier   Main config file ...
70
# sqlalchemy_devdb_uri = postgres_dev_uri
b4ff40eb   hitier   More comments in ...
71
72
73
74
75

# The unit tests database:
# ( defaults to in memory sqlite db: 'sqlite:///:memory:' )
#
# sqlalchemy_testdb_uri = postgres_test_uri