from .base import *  # noqa: F403
from .utils import get_current_version


DEBUG = True

INSTALLED_APPS += ["debug_toolbar", "django_extensions"]  # noqa: F405

MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"]  # noqa: F405

LOGGING["loggers"].update(  # noqa: F405
    {
        "celery.task": {"handlers": ["console", "celery"], "level": "DEBUG"},
    }
)

EMAIL_BACKEND = "django.core.mail.backends.console.EmailBackend"


TEMPLATES[0]["OPTIONS"]["context_processors"].append(  # noqa: F405
    "django.template.context_processors.debug",
)

# Project settings
VERSION = get_current_version()
ENVIRONMENT = "docker"

# Third party settings
# Axes
AXES_FAILURE_LIMIT = 50
AXES_COOLOFF_TIME = None

try:
    # Optionally use sentry integration
    from sentry_sdk import init as sentry_init

    from .local import *  # noqa

    SENTRY_CONFIG.update({"release": VERSION, "environment": ENVIRONMENT})  # noqa: F405

    sentry_init(**SENTRY_CONFIG)  # noqa: F405
except ImportError:
    pass
