Commit bff135dc authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Introduce database user, pwd and host constants.

parent 4282b34c
......@@ -5,9 +5,23 @@
Define constants for the different role
"""
DB_MYSQL = 'mysql://GesProd:Prod_CPPM@maretude.in2p3.fr/GesProd'
# Production at CPPM
HOST = 'maretude.in2p3.fr'
USER = 'GesProd'
PWD = 'Prod_CPPM'
DATABASE = 'GesProd'
# Test database
# DB_HOST = 'localhost'
# DB_USER = 'GesProd'
# DB_PWD = 'Prod_CPPM'
# DATABASE = 'test_publications'
# DATABASE = 'foo'
# Migration flag
MIGRATE = False
# Roles
ID_ADMIN, ADMIN, DEF_ADMIN = 1, 'admin', 'administrators, librairians,...'
ID_USER, USER, DEF_USER = 2, 'user', 'liaisons, team leaders,...'
......@@ -17,17 +31,11 @@ ID_USER, USER, DEF_USER = 2, 'user', 'liaisons, team leaders,...'
#
#-------------------------------------------------------------------------------
try:
db = DAL(DB_MYSQL, lazy_tables=False, migrate_enabled=MIGRATE, pool_size=10)
mysql = 'mysql://%s:%s@%s/%s' % (DB_USER, DB_PWD, DB_HOST, DATABASE)
db = DAL(mysql, lazy_tables=False, migrate_enabled=MIGRATE, pool_size=10)
except:
raise HTTP(500, T("Can't access the MySQL database !!!"))
#-------------------------------------------------------------------------------
#
# SQLITE database (test)
#
#-------------------------------------------------------------------------------
# db = DAL('sqlite://storage.sqlite', lazy_tables=False, migrate_enabled=MIGRATE)
#-------------------------------------------------------------------------------
#
# virtual database
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment