import os from db_config import * root_dir = os.path.abspath(os.path.dirname(__file__)) # # SQLALCHEMY_DATABASE_URI will default to 'sqlite:///:memory:' if not set # class Config(object): SECRET_KEY = 'dev' # Please change the following to fit you own site parameters # PDC_APP_NAME = 'Plan de Charge' PDC_SITE_NAME = 'NO_SITE' # choose among IRAP, PUBLIC, ... PDC_SITE_CLASS = 'public-icon' # choose among admin-icon, public-icon PDC_LOGS_LEVEL = 'DEBUG' # choose within DEBUG, INFO, WARN, ERROR ( more levels in logging module ) PDC_LOGS_DIR = os.path.join(root_dir, 'logs') PDC_LOGS_FILE = os.path.join(PDC_LOGS_DIR, 'pdc.log') # Uncomment for role access control # if True, will disable any role control on routes # note that this doesnt disable the @login_required # # ROLE_DISABLED = False # Uncomment for site access control # if True, will force login access on any site page # note that this doesnt disable the @login_required # # SITE_LOGIN = False # # No need to Edit below # # You can force logging to stdout in production environment # (make sure your httpd/wsgi server can redirect to log files) LOG_TO_STDOUT = os.environ.get('LOG_TO_STDOUT') if LOG_TO_STDOUT and LOG_TO_STDOUT.upper() == "true".upper(): LOG_TO_STDOUT = True SQLALCHEMY_TRACK_MODIFICATIONS = False # Trying to set specific db uri from ./db_config.py try: SQLALCHEMY_DATABASE_URI = sqlalchemy_database_uri except NameError: SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \ 'sqlite:///' + os.path.join(root_dir, 'pdc_app.db') try: LESIA_AGENTS_DB_URI = mysql_lesia_uri except NameError: LESIA_AGENTS_DB_URI = os.environ.get('LESIA_AGENTS_DB_URI') or \ 'sqlite:///' + os.path.join(root_dir, 'lesia.db') with open(os.path.join(root_dir, 'VERSION.txt')) as version_file: VERSION = version_file.read().strip() class ProdConfig(Config): TESTING = False DEBUG = False class DevConfig(Config): DEBUG = True # Trying to set specific db uri from ./db_config.py try: SQLALCHEMY_DATABASE_URI = sqlalchemy_devdb_uri except NameError: SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \ 'sqlite:///' + os.path.join(root_dir, 'pdc_app_dev.db') # ignores @login_required decorator LOGIN_DISABLED = True # ignores @role_required decorator ROLE_DISABLED = True class TestConfig(Config): TESTING = True DEBUG = True PDC_LOGS_LEVEL = 'ERROR' # choose within DEBUG, INFO, WARN, ERROR ( more levels in logging module ) # Trying to set specific db uri from ./db_config.py try: SQLALCHEMY_DATABASE_URI = sqlalchemy_testdb_uri except NameError: SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \ 'sqlite:///' + os.path.join(root_dir, 'pdc_app_test.db') # ignores @login_required decorator LOGIN_DISABLED = True # ignores @role_required decorator ROLE_DISABLED = True # vim: tw=0