db_config.py
1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# 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.
#
SQLITE = {
'file': '/path/to/directory/pdc.db'
}
sqlite_uri = 'sqlite:///%(file)s' % SQLITE
MYSQL = {
'user': 'mysql',
'pw': 'mysql',
'db': 'pdc_db',
'host': '127.0.0.1',
'port': '3306',
}
mysql_uri = 'mysql+pymysql://%(user)s:%(pw)s@%(host)s:%(port)s/%(db)s' % MYSQL
POSTGRES = {
'user': 'pdc-user',
'pw': 'pdc-pwd',
'db': 'pdc-db',
'host': '127.0.0.1',
'port': '5432',
}
postgres_uri = 'postgresql://%(user)s:%(pw)s@%(host)s:%(port)s/%(db)s' % POSTGRES
# 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.
#
POSTGRESTEST = {
'user': 'pdctest-user',
'pw': 'pdctest-pwd',
'db': 'pdctest-test-db',
'host': '127.0.0.1',
'port': '5434',
}
postgres_test_uri = 'postgresql://%(user)s:%(pw)s@%(host)s:%(port)s/%(db)s' % POSTGRESTEST
# The lesia mysql agents database
# It is possible to connect to a lesia like mysql db.
# set it here
MYSQL_LESIA = {
'user': 'mysql',
'pw': 'mysql',
'db': 'lesia_db',
'host': '127.0.0.1',
'port': '3306',
}
mysql_lesia_uri = 'mysql+pymysql://%(user)s:%(pw)s@%(host)s:%(port)s/%(db)s' % MYSQL_LESIA
# 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 )
#
# The main database for a production site:
# ( defaults to an sqlite db file )
#
# sqlalchemy_database_uri = mysql_uri
# sqlalchemy_database_uri = sqlite_uri
# sqlalchemy_database_uri = postgres_uri
# The development database:
# ( defaults to an sqlite db file )
#
# sqlalchemy_devdb_uri = postgres_dev_uri
# The unit tests database:
# ( defaults to in memory sqlite db: 'sqlite:///:memory:' )
#
# sqlalchemy_testdb_uri = postgres_test_uri