import os
from .base import *

DEBUG = True
ALLOWED_HOSTS = ['localhost', '127.0.0.1','posapp.co.ke', 'a85aef78-3539-414f-9908-8fe0c12d570b-00-3ed8ao1wbx9ms.riker.replit.dev', '*']

# Use external PostgreSQL database
DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql',
        'NAME': 'pos',
        'USER': 'pos_user',
        'PASSWORD': 'RjNX;QD8HWtDFM',
        'HOST': '41.90.117.217',
        'PORT': '5432',
    }
}

CSRF_TRUSTED_ORIGINS = [
    'https://a85aef78-3539-414f-9908-8fe0c12d570b-00-3ed8ao1wbx9ms.riker.replit.dev',
    'https://a85aef78-3539-414f-9908-8fe0c12d570b-00-3ed8ao1wbx9ms.riker.replit.dev:5000',
    'https://posapp.co.ke',
    'htttps://www.posapp.co.ke'

]

# Allow all hosts for Replit development
X_FRAME_OPTIONS = 'ALLOWALL'

# CSRF settings for Replit development
CSRF_COOKIE_SECURE = False  # Allow over HTTP in development
CSRF_COOKIE_SAMESITE = 'Lax'
CSRF_USE_SESSIONS = False
CSRF_COOKIE_HTTPONLY = False
CSRF_COOKIE_DOMAIN = None  # Allow all domains in development
