import os
from config.env import BASE_DIR, env 

# PROJECT_ROOT = os.path.normpath(os.path.dirname(__file__))

env.read_env(os.path.join(BASE_DIR, '.env'))

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django_filters',
    'corsheaders',
    'rest_framework',
    # 'rest_framework.authtoken',   
    "rest_framework_api_key",
    'socials',
    'events',
    'contracts',
    'datasnaxx',
    'config',
    # 'academia_nuts',
    # 'leg_info',
]

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

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'db.sqlite3',
    },
    'default2': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': BASE_DIR / 'db2.sqlite3',
    }
}

CORS_ALLOWED_ORIGINS = [
    'http://localhost:5173', 
    'https://digisnaxx.com',
    'https://www.digisnaxx.com',
    'https://www.canincarlos.com',
    'https://canincarlos.com',
    'https://dreamfreely.org',
    'https://www.dreamfreely.org'
    ]

from config.django.core import *
from config.settings.restframework import *