#!/usr/bin/env python
"""
Django's command-line utility for administrative tasks.

This module provides the main entry point for Django management commands.
It sets up the Django environment and executes management commands.

Author: Adtlas Development Team
Project: Adtlas
Version: 1.0.0
"""
import os
import sys


def main():
    """
    Run administrative tasks for the Django project.
    
    This function sets the default Django settings module and executes
    management commands from the command line.
    
    Raises:
        ImportError: If Django is not installed or not available in the Python path.
    """
    # Set the default Django settings module for the project
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'core.settings')
    
    try:
        # Import Django's command-line utility
        from django.core.management import execute_from_command_line
    except ImportError as exc:
        # Raise a more descriptive error if Django is not installed
        raise ImportError(
            "Couldn't import Django. Are you sure it's installed and "
            "available on your PYTHONPATH environment variable? Did you "
            "forget to activate a virtual environment?"
        ) from exc
    
    # Execute the command-line utility with provided arguments
    execute_from_command_line(sys.argv)


if __name__ == '__main__':
    # Entry point for the Django management script
    main()