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

[((101, 114), 'dotenv.load_dotenv', 'load_dotenv', ([], {}), '()\n', (112, 114), False, 'from dotenv import load_dotenv\n'), ((235, 260), 'os.environ.get', 'environ.get', (['"""SECRET_KEY"""'], {}), "('SECRET_KEY')\n", (246, 260), False, 'from os import environ\n'), ((273, 295), 'os.environ.get', 'environ.get', (['"""DB_USER"""'], {}), "('DB_USER')\n", (284, 295), False, 'from os import environ\n'), ((311, 337), 'os.environ.get', 'environ.get', (['"""DB_PASSWORD"""'], {}), "('DB_PASSWORD')\n", (322, 337), False, 'from os import environ\n'), ((352, 374), 'os.environ.get', 'environ.get', (['"""DB_NAME"""'], {}), "('DB_NAME')\n", (363, 374), False, 'from os import environ\n'), ((386, 408), 'os.environ.get', 'environ.get', (['"""DB_HOST"""'], {}), "('DB_HOST')\n", (397, 408), False, 'from os import environ\n'), ((603, 628), 'os.environ.get', 'environ.get', (['"""SECRET_KEY"""'], {}), "('SECRET_KEY')\n", (614, 628), False, 'from os import environ\n'), ((660, 677), 'datetime.timedelta', 'timedelta', ([], {'days': '(1)'}), '(days=1)\n', (669, 677), False, 'from datetime import timedelta\n')]