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

Migrate to the mariadb database.

parent feec289a
......@@ -5,9 +5,17 @@
Define constants for the different role
"""
DB_MYSQL = 'mysql://GesProd:Prod_CPPM@maretude.in2p3.fr/XXXX'
# Production at localhost
DB_HOST = 'localhost'
DB_USER = 'GesProd'
DB_PWD = 'Prod_CPPM'
DATABASE = 'lhcbfrance'
# Migration flags
MIGRATE = False
MIGRATE_USER = False
# Roles
ID_ADMIN, ADMIN, DEF_ADMIN = 1, 'admin', 'administrators, team leader,...'
ID_USER, USER, DEF_USER = 2, 'user', 'project leader,...'
......@@ -16,18 +24,18 @@ ID_USER, USER, DEF_USER = 2, 'user', 'project leader,...'
# MYSQL database
#
#-------------------------------------------------------------------------------
# connection to the database
# try:
# db = DAL(DB_MYSQL, lazy_tables=True, migrate_enabled=MIGRATE, pool_size=10)
# except:
# raise HTTP(500, T("Can't access the MySQL database !!!"))
try:
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)
# db = DAL('sqlite://storage.sqlite', lazy_tables=False, migrate_enabled=MIGRATE)
#-------------------------------------------------------------------------------
#
......
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