Skip to content

Commit ed4e603

Browse files
authored
Set default_app_config only in Django 3.1 or less (django-es#343)
* Set default_app_config only in Django 3.1 or less * Fixed missing import
1 parent 6e15725 commit ed4e603

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

django_elasticsearch_dsl/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import django
2+
13
from django.utils.module_loading import autodiscover_modules
24

35
from .documents import Document # noqa
@@ -11,4 +13,5 @@ def autodiscover():
1113
autodiscover_modules('documents')
1214

1315

14-
default_app_config = 'django_elasticsearch_dsl.apps.DEDConfig'
16+
if django.VERSION < (3, 2):
17+
default_app_config = 'django_elasticsearch_dsl.apps.DEDConfig'

0 commit comments

Comments
 (0)