from os import environ
import psycopg2
from datetime import timedelta
from dotenv import load_dotenv
load_dotenv()

class Config(object):
    """ app configuration class """
    TESTING = False
    CSRF_ENABLED = True
    SECRET_KEY = environ.get('SECRET_KEY')

    USER = environ.get('DB_USER')
    PASSWORD = environ.get('DB_PASSWORD')
    DB_NAME = environ.get('DB_NAME')
    HOST = environ.get('DB_HOST')
    SQLALCHEMY_DATABASE_URI = f"postgresql://{USER}:{PASSWORD}@{HOST}/{DB_NAME}"
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    # jwt configuarations for the user auth api
    JWT_SECRET_KEY = environ.get('SECRET_KEY')
    JWT_ACCESS_TOKEN_EXPIRES = timedelta(days=1)

    # pagination
    NUM_OF_ITEMS_PER_PAGE = 18

class DevelopmentConfig(Config):
    """ app development configuration class """
    ENV = "development"
    DEBUG = True
    SQLALCHEMY_TRACK_MODIFICATIONS = True

class ProductionConfig(Config):
    DEBUG = False
    SQLALCHEMY_TRACK_MODIFICATIONS = False

[((5, 0, 5, 13), 'dotenv.load_dotenv', 'load_dotenv', ({}, {}), '()', False, 'from dotenv import load_dotenv\n'), ((11, 17, 11, 42), 'os.environ.get', 'environ.get', ({(11, 29, 11, 41): '"""SECRET_KEY"""'}, {}), "('SECRET_KEY')", False, 'from os import environ\n'), ((13, 11, 13, 33), 'os.environ.get', 'environ.get', ({(13, 23, 13, 32): '"""DB_USER"""'}, {}), "('DB_USER')", False, 'from os import environ\n'), ((14, 15, 14, 41), 'os.environ.get', 'environ.get', ({(14, 27, 14, 40): '"""DB_PASSWORD"""'}, {}), "('DB_PASSWORD')", False, 'from os import environ\n'), ((15, 14, 15, 36), 'os.environ.get', 'environ.get', ({(15, 26, 15, 35): '"""DB_NAME"""'}, {}), "('DB_NAME')", False, 'from os import environ\n'), ((16, 11, 16, 33), 'os.environ.get', 'environ.get', ({(16, 23, 16, 32): '"""DB_HOST"""'}, {}), "('DB_HOST')", False, 'from os import environ\n'), ((21, 21, 21, 46), 'os.environ.get', 'environ.get', ({(21, 33, 21, 45): '"""SECRET_KEY"""'}, {}), "('SECRET_KEY')", False, 'from os import environ\n'), ((22, 31, 22, 48), 'datetime.timedelta', 'timedelta', (), '', False, 'from datetime import timedelta\n')]