"""
Django settings for msgs project.

Generated by 'django-admin startproject' using Django 3.0.7.

For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""

import os

# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/3.0/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = ')m0%=k+$mdhtp3w*8^4$cv*sgyy+nhpc%09)-ci1qj0h54!mer'

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ["*", ]


# Application definition

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',

    # 'django_json_widget',

    'msgs',
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'config.urls'

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

WSGI_APPLICATION = 'config.wsgi.application'


# Database
# https://docs.djangoproject.com/en/3.0/ref/settings/#databases

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
    }
}


# Password validation
# https://docs.djangoproject.com/en/3.0/ref/settings/#auth-password-validators

AUTH_PASSWORD_VALIDATORS = [
    {
        'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
    },
    {
        'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
    },
]


# Internationalization
# https://docs.djangoproject.com/en/3.0/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/3.0/howto/static-files/

STATIC_URL = '/static/'


# MSGS
MSGS = {
    'providers': {
        # MY SETTINGS
        'sendgrid': {
            'backend': 'msgs.providers.sendgrid.SendgridEmailProvider',
            'options': {
                'is_active': True,
                'api_key': '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',  # My
                'webhook_verification_key': 'MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEgy47bNSzNjiKSzuOERttvy2G3atoCOOTmFa+Pr29nMd9MsRL7Ym6jnOWfYFLh4NvrL86GGI9vS58HkTgNNRtGQ==',
                'sender': [
                    'sunnywebdevelopment@gmail.com',
                ],
            },
        },
        # # SPEEON SETTINGS AE3 PROD
        # 'sendgrid': {
        #     'backend': 'msgs.providers.sendgrid.SendgridEmailProvider',
        #     'options': {
        #         'is_active': True,
        #         'api_key': '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',
        #         'sender': [
        #             'notifications@hma.ca',
        #             'nicole.f@hma.ca',
        #             'admin@hma.ca',
        #         ],
        #         'skip_duplicates': True,
        #     },
        # },
        'sendinblue': {
            'backend': 'msgs.providers.sendinblue.SendinblueEmailProvider',
            'options': {
                'is_active': True,
                'api_key': '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',
                'sender_email': 'san4ezy@email.com',
                'sender_name': 'test',
            },
        },
        'twilio': {
            'backend': 'msgs.providers.twilio.TwilioProvider',
            'options': {
                'is_active': True,
                'account_sid': 'AC4dbce5d6ef60c86c86561cfc2222ffa9',
                'auth_token': '43030261b80e03860fb0c0752b9262f8',
                'sender': '+13343730227',
            },
        },
        'telegram': {
            'backend': 'msgs.providers.telegram.TelegramProvider',
            'options': {
                'is_active': True,
                'token': '1848056858:AAEfvR26GkporfuAPKhDu0weIEV9dSmlfXw',
                # 'chat': ['352205105', '535989780', ],
                'sender': 'Bot',
            },
        },
        'dummy': {
            'backend': 'msgs.providers.dummy.DummyProvider',
            'options': {
                'is_active': True,
                'model': 'msgs.SMS',
                'sender': 'Dummy',
            }
        },
    },
    'options': {
        'default_language': 'en',
        'skip_duplicates': False,
        'auto_duplicate': True,
        'raise_exceptions': True,
        'auto_delete': False,
    },
    'development': 'telegram',
    'email': 'sendgrid',
    'sms': 'twilio',
    'message': 'telegram',
}
