diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 84fdb557..b17716bc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: python-version: ['3.7', '3.8', '3.9', '3.10'] - django-version: ['3.2', '4.0', 'main'] + django-version: ['2.2', '3.2', '4.0', 'main'] services: postgres: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8f0ad998..7a20e3d4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,7 +55,7 @@ repos: rev: '1.7.0' hooks: - id: django-upgrade - args: [--target-version, '3.2'] + args: [--target-version, '2.2'] - repo: https://github.com/pre-commit/mirrors-autopep8 rev: 'v1.6.0' hooks: diff --git a/README.md b/README.md index 37f6f9a1..3adaead4 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Silk is a live profiling and inspection tool for the Django framework. Silk inte Silk has been tested with: -* Django: 3.2, 4.0 +* Django: 2.2, 3.2, 4.0 * Python: 3.7, 3.8, 3.9, 3.10 ## Installation diff --git a/docs/index.rst b/docs/index.rst index 18a99a83..f2719213 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -57,5 +57,5 @@ Features Requirements ------------ -* Django: 3.2, 4.0 +* Django: 2.2, 3.2, 4.0 * Python: 3.7, 3.8, 3.9, 3.10 diff --git a/setup.py b/setup.py index b242c44d..782a1aa3 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,7 @@ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', + 'Framework :: Django :: 2.2', 'Framework :: Django :: 3.2', 'Framework :: Django :: 4.0', 'Intended Audience :: Developers', @@ -34,7 +35,7 @@ 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], install_requires=[ - 'Django>=3.2', + 'Django>=2.2', 'python-dateutil', 'requests', 'sqlparse', diff --git a/silk/__init__.py b/silk/__init__.py index c18af4b9..c109f956 100644 --- a/silk/__init__.py +++ b/silk/__init__.py @@ -1,6 +1,10 @@ +import django from pkg_resources import DistributionNotFound, get_distribution try: __version__ = get_distribution("django-silk").version except DistributionNotFound: pass + +if django.VERSION < (3, 2): + default_app_config = "silk.apps.SilkAppConfig" diff --git a/tox.ini b/tox.ini index 6e72b343..002e58dc 100644 --- a/tox.ini +++ b/tox.ini @@ -7,12 +7,14 @@ python = [gh-actions:env] DJANGO = + 2.2: dj22 3.2: dj32 4.0: dj40 main: djmain [tox] envlist = + py{37,38,39}-dj{22,32}-{sqlite3,mysql,postgresql} py{37,38,39,310}-dj32-{sqlite3,mysql,postgresql} py{38,39,310}-dj{40,main}-{sqlite3,mysql,postgresql} @@ -25,6 +27,7 @@ deps = -rrequirements.txt mysql: mysqlclient postgresql: psycopg2-binary<2.9 + dj22: django>=2.2,<2.3 dj32: django>=3.2,<3.3 dj40: django>=4.0,<4.1 djmain: https://github.com/django/django/archive/main.tar.gz