codeflash-internal/django/aiservice/core/apps.py
Saurabh Misra 198c0c1a4e
codeflash-omni-java (#2335)
# Pull Request Checklist

## Description
- [ ] **Breaking Changes**: Document any breaking changes (if
applicable)
- [ ] **Description of PR**: Clear and concise description of what this
PR accomplishes
- [ ] **Related Issues**: Link to any related issues or tickets

## Testing
- [ ] **Test cases Attached**: All relevant test cases have been
added/updated
- [ ] **Manual Testing**: Manual testing completed for the changes

## Monitoring & Debugging
- [ ] **Logging in place**: Appropriate logging has been added for
debugging user issues
- [ ] **Sentry will be able to catch errors**: Error handling ensures
Sentry can capture and report errors
- [ ] **Avoid Dev based/Prisma logging**: No development-only or
Prisma-specific logging in production code

## Configuration
- [ ] **Env variables newly added**: Any new environment variables are
documented in .env.example file or mentioned in description
---

## Additional Notes
<!-- Add any additional context, screenshots, or notes for reviewers
here -->

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: HeshamHM28 <HeshamMohamedFathy@outlook.com>
Co-authored-by: Ubuntu <ubuntu@ip-172-31-39-200.ec2.internal>
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com>
Co-authored-by: Kevin Turcios <turcioskevinr@gmail.com>
Co-authored-by: Kevin Turcios <106575910+KRRT7@users.noreply.github.com>
2026-02-13 23:26:55 +05:30

39 lines
1.3 KiB
Python

"""Core infrastructure Django app configuration."""
import importlib
import logging
from django.apps import AppConfig
logger = logging.getLogger(__name__)
class CoreConfig(AppConfig):
"""Django app configuration for the core infrastructure module.
This app must be loaded before any feature apps (testgen, optimizer, code_repair)
to ensure the handler registry is initialized and protocols are available.
"""
default_auto_field = "django.db.models.BigAutoField"
name = "core"
verbose_name = "Core Infrastructure"
def ready(self) -> None:
"""Initialize core infrastructure when Django starts."""
logger.info("Core app initializing...")
# Import language handlers from core.languages
# This ensures the handlers get registered via their __init__.py
for module_name, label in [
("core.languages.python", "Python"),
("core.languages.js_ts", "JavaScript/TypeScript"),
("core.languages.java", "Java"),
]:
try:
importlib.import_module(module_name)
logger.info("%s language handler imported and registered", label)
except ImportError:
logger.warning("Could not import %s language handler", label, exc_info=True)
logger.info("Core app initialization complete")