Skip to content

Commit 73fafa0

Browse files
authored
Merge pull request django-commons#27 from enkore/migrations-setting
Add PROMETHEUS_EXPORT_MIGRATIONS (True) setting
2 parents 912f772 + 1a400d4 commit 73fafa0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

django_prometheus/apps.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from django.apps import AppConfig
2+
from django.conf import settings
23
from django_prometheus.exports import SetupPrometheusExportsFromConfig
34
from django_prometheus.migrations import ExportMigrations
45
# unused import to force instantiating the metric objects at startup.
@@ -19,4 +20,5 @@ def ready(self):
1920
are usually short-lived), but can be useful for debugging.
2021
"""
2122
SetupPrometheusExportsFromConfig()
22-
ExportMigrations()
23+
if getattr(settings, 'PROMETHEUS_EXPORT_MIGRATIONS', True):
24+
ExportMigrations()

0 commit comments

Comments
 (0)