import os

APP_ROOT = os.path.dirname(os.path.abspath(__file__))   # refers to application_top
APP_STATIC = os.path.join(APP_ROOT, 'static')
APP_BASE_DIR = os.path.abspath(os.path.dirname(__file__))
APP_DATA_BASE_DIR = os.path.join(APP_ROOT,'database')

class Config(object):
    APP_ROOT = os.path.dirname(os.path.abspath(__file__))  # refers to application_top
    APP_STATIC = os.path.join(APP_ROOT, 'static')
    APP_BASE_DIR = os.path.abspath(os.path.dirname(__file__))
    APP_DATA_BASE_DIR = os.path.join(APP_ROOT, 'database')

    SECRET_KEY = os.environ.get('SECRET_KEY') or 'the_north_remembers'
    SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or 'sqlite:///' + os.path.join(APP_DATA_BASE_DIR, 'app.db')
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    MAIL_SERVER = os.environ.get('MAIL_SERVER')
    MAIL_PORT = int(os.environ.get('MAIL_PORT') or 25)
    MAIL_USE_TLS = os.environ.get('MAIL_USE_TLS') is not None
    MAIL_USERNAME = os.environ.get('MAIL_USERNAME')
    MAIL_PASSWORD = os.environ.get('MAIL_PASSWORD')
    ADMINS = ['wissam.benhaddad.pro@fmail.com']

    ROOT_TRANS = '/transcriptions/01/'
    SAVING_PATH = (APP_BASE_DIR+ ROOT_TRANS)
