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


DEBUG = True


del LOGGING["handlers"]["file"]  # noqa: F405
del LOGGING["handlers"]["celery"]  # noqa: F405

LOGGING["loggers"].update(  # noqa: F405
    {
        "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.PyMemcacheCache",
        "LOCATION": "memcached:11211",
    },
    "axes": {
        "BACKEND": "django.core.cache.backends.memcached.PyMemcacheCache",
        "LOCATION": "memcached:11211",
    },
}

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

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

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

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