diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index c9e018b4..eabaa693 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -25,7 +25,7 @@ jobs: - django_version: '3.1' python_version: '3.5' - - django_version: '3.1' + - django_version: '3.2' python_version: '3.5' include: - django_version: '2.2' @@ -66,7 +66,7 @@ jobs: sudo apt-get install -y libproj-dev libgeos-dev gdal-bin libgdal-dev python -m pip install --upgrade pip pip install -U flake8 coveralls psycopg2-binary argparse - pip install -U Django~=${{ matrix.django_version }} + pip install -U Django~=${{ matrix.django_version }}.0 - name: Lint with flake8 run: | flake8 --ignore=E501,W504 leaflet diff --git a/leaflet/__init__.py b/leaflet/__init__.py index 9178fcd4..632f1fc2 100644 --- a/leaflet/__init__.py +++ b/leaflet/__init__.py @@ -1,6 +1,8 @@ from collections import OrderedDict +from distutils.version import LooseVersion from urllib.parse import urlparse +import django from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.templatetags.static import static @@ -182,4 +184,5 @@ def _normalize_plugins_config(): PLUGINS['__is_normalized__'] = True -default_app_config = 'leaflet.apps.LeafletConfig' +if LooseVersion(django.__version__) < LooseVersion('3.2'): + default_app_config = 'leaflet.apps.LeafletConfig' diff --git a/tox.ini b/tox.ini index 82a21be8..f3d1b7ba 100644 --- a/tox.ini +++ b/tox.ini @@ -9,10 +9,10 @@ envlist = [testenv] commands = python -W error::DeprecationWarning -W error::PendingDeprecationWarning -m coverage run ./quicktest.py leaflet --db={env:DATABASE:} deps = - django22: Django~=2.2 - django30: Django~=3.0 - django31: Django~=3.1 - django32: Django~=3.2 + django22: Django~=2.2.0 + django30: Django~=3.0.0 + django31: Django~=3.1.0 + django32: Django~=3.2.0 djangomain: https://github.com/django/django/archive/main.tar.gz postgres: psycopg2-binary coverage