from .base import *  # isort:skip
from .version import get_current_version


ALLOWED_HOSTS = ["django", "127.0.0.1"]

INSTALLED_APPS += ["debug_toolbar", "django_extensions"]

MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"]

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

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

DEBUG = True

# 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})

    sentry_init(**SENTRY_CONFIG)
except ImportError:
    pass
