Skip to content

Commit 46f6053

Browse files
authored
Merge pull request #277 from lowitea/patch-1
Remove deprecation warning
2 parents 482915d + 5f4e79f commit 46f6053

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

django_prometheus/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
# Import all files that define metrics. This has the effect that
77
# `import django_prometheus` will always instantiate all metric
88
# objects right away.
9+
import django
910
from django_prometheus import middleware, models
1011

1112
__all__ = ["middleware", "models", "pip_prometheus"]
@@ -19,4 +20,5 @@
1920
# If people don't have pip, don't export anything.
2021
pass
2122

22-
default_app_config = "django_prometheus.apps.DjangoPrometheusConfig"
23+
if django.VERSION < (3, 2):
24+
default_app_config = "django_prometheus.apps.DjangoPrometheusConfig"

0 commit comments

Comments
 (0)