from dotenv import load_dotenv
import os

load_dotenv()

DEBUG = os.environ.get('DEBUG', 'True') == 'True'

DATABASE_CONFIG = {
    'ENGINE': 'django.db.backends.postgresql',
    'OPTIONS': {
        'service': 'pg_service',
        'passfile': '.pgpass'
    }
}
SECRET_KEY = os.environ.get('SECRET_KEY', '')
CACHE_CONFIG = {
    'LOCATION': 'redis://127.0.0.1:6379',
    'BACKEND': 'django.core.cache.backends.redis.RedisCache',
}

SENTRY_DSN = os.environ.get('SENTRY_DSN', '')
SENTRY_ENV = os.environ.get('SENTRY_ENV', 'development')

FACEBOOK_PIXEL_ID = os.environ.get('FACEBOOK_PIXEL_ID', '')

STRIPE_API_KEY = os.environ.get('STRIPE_API_KEY', '')

PAYPAL_CLIENT_ID = os.environ.get('PAYPAL_CLIENT_ID', '')
PAYPAL_SECRET_ID = os.environ.get('PAYPAL_SECRET_ID', '')
PAYPAL_ENVIRONMENT = os.environ.get('PAYPAL_ENVIRONMENT', 'SANDBOX')
USPS_USER_ID = os.environ.get('USPS_USER_ID', '639NATHA3105')
DEFAULT_ZIP_ORIGINATION = os.environ.get('DEFAULT_ZIP_ORIGINATION', '98368')

ANYMAIL_CONFIG = {
    'MAILGUN_API_KEY': os.environ.get('MAILGUN_API_KEY', ''),
    'MAILGUN_SENDER_DOMAIN': os.environ.get('MAILGUN_SENDER_DOMAIN', '')
}

ADMIN_EMAIL = os.environ.get('ADMIN_EMAIL', 'debug@nathanjchapman.com')
SERVER_EMAIL = os.environ.get('SERVER_EMAIL', '')
DEFAULT_FROM_EMAIL = os.environ.get('DEFAULT_FROM_EMAIL', '')
DEFAULT_CONTACT_EMAIL = os.environ.get('DEFAULT_CONTACT_EMAIL', '')
ORDER_FROM_EMAIL = os.environ.get('ORDER_FROM_EMAIL', '')
STATIC_ROOT_PATH = os.environ.get('STATIC_ROOT_PATH', '/var/www/ptcoffee-dev/static/')

SECURE_HSTS_SECONDS = os.environ.get('SECURE_HSTS_SECONDS', 3600)
SECURE_SSL_REDIRECT = os.environ.get('SECURE_SSL_REDIRECT', 'False') == 'True'
SESSION_COOKIE_SECURE = os.environ.get('SESSION_COOKIE_SECURE', 'False') == 'True'
CSRF_COOKIE_SECURE = os.environ.get('CSRF_COOKIE_SECURE', 'False') == 'True'
SECURE_CROSS_ORIGIN_OPENER_POLICY = 'same-origin-allow-popups'
