"""
ASGI config for django_project project.

It exposes the ASGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/5.0/howto/deployment/asgi/
"""

import os

from django.core.asgi import get_asgi_application

# Determine which settings to use based on environment
if os.environ.get('REPLIT_DEPLOYMENT'):
    # Replit deployment environment
    default_settings = 'django_project.settings.production'
elif os.environ.get('DJANGO_SETTINGS_MODULE'):
    # Use explicitly set settings module
    default_settings = os.environ.get('DJANGO_SETTINGS_MODULE')
elif os.environ.get('REPLIT_DOMAINS'):
    # Replit development environment
    default_settings = 'django_project.settings.development'
else:
    # Production server (default to production settings)
    default_settings = 'django_project.settings.production'

os.environ.setdefault('DJANGO_SETTINGS_MODULE', default_settings)

application = get_asgi_application()
