db_config.py 1.98 KB
# 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