diff --git a/cachalot/apps.py b/cachalot/apps.py index 1651062..c0d122a 100644 --- a/cachalot/apps.py +++ b/cachalot/apps.py @@ -1,3 +1,4 @@ +from django import VERSION as django_version from django.apps import AppConfig from django.conf import settings from django.core.checks import register, Tags, Warning, Error @@ -9,7 +10,11 @@ from .settings import ( SUPPORTED_ONLY) -@register(Tags.caches, Tags.compatibility) +DJANGO_GTE_1_10 = django_version[:2] >= (1, 10) + + +@register(*((Tags.caches, Tags.compatibility) + if DJANGO_GTE_1_10 else (Tags.compatibility,))) def check_cache_compatibility(app_configs, **kwargs): cache = settings.CACHES[cachalot_settings.CACHALOT_CACHE] cache_backend = cache['BACKEND'] @@ -23,7 +28,8 @@ def check_cache_compatibility(app_configs, **kwargs): return [] -@register(Tags.database, Tags.compatibility) +@register(*((Tags.database, Tags.compatibility) + if DJANGO_GTE_1_10 else (Tags.compatibility,))) def check_databases_compatibility(app_configs, **kwargs): errors = [] databases = settings.DATABASES