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


DEBUG = True


del LOGGING["handlers"]["file"]
del LOGGING["handlers"]["celery"]

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


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

AXES_ENABLED = False

CACHES = {
    "default": {
        "BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
        "LOCATION": "memcached:11211",
    },
    "axes": {
        "BACKEND": "django.core.cache.backends.memcached.MemcachedCache",
        "LOCATION": "memcached:11211",
    },
}

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

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

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

    sentry_init(**SENTRY_CONFIG)
except ImportError:
    pass
