diff --git a/README.md b/README.md index 02a6fddc..45cfd192 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.2, 5.0, 5.1 +* Django: 4.2, 5.0, 5.1 * Python: 3.8, 3.9, 3.10, 3.11, 3.12 ## Installation diff --git a/docs/index.rst b/docs/index.rst index 9fec7dee..011a0bff 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -57,5 +57,5 @@ Features Requirements ------------ -* Django: 3.2, 4.2, 5.0, 5.1 +* Django: 4.2, 5.0, 5.1 * Python: 3.8, 3.9, 3.10 diff --git a/project/project/settings.py b/project/project/settings.py index e3586db7..8428f3f5 100644 --- a/project/project/settings.py +++ b/project/project/settings.py @@ -22,7 +22,6 @@ ROOT_URLCONF = 'project.urls' -# Django 3.2+ DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' MIDDLEWARE = [ diff --git a/project/tests/test_view_requests.py b/project/tests/test_view_requests.py index 5fc3a3a0..d36e93fd 100644 --- a/project/tests/test_view_requests.py +++ b/project/tests/test_view_requests.py @@ -26,19 +26,6 @@ def test_order_by(self): class TestContext(TestCase): - def assertQuerySetEqual(self, *args, **kwargs): - """ - A shim for QuerySetEqual to enable support for multiple versions of Django - TODO: delete this after support for Django 3.2 is dropped - Reference: https://docs.djangoproject.com/en/5.0/topics/testing/tools/#django.test.TransactionTestCase.assertQuerySetEqual - """ - if hasattr(super(), 'assertQuerySetEqual'): - # Django > 3.2 - super().assertQuerySetEqual(*args, **kwargs) - else: - # Django < 5.1 - super().assertQuerysetEqual(*args, **kwargs) - def test_default(self): request = Mock(spec_set=['GET', 'session']) request.session = {} diff --git a/setup.py b/setup.py index e076f135..73a6ae83 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,6 @@ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', - 'Framework :: Django :: 3.2', 'Framework :: Django :: 4.2', 'Framework :: Django :: 5.0', 'Framework :: Django :: 5.1', @@ -37,7 +36,7 @@ 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', ], install_requires=[ - 'Django>=3.2', + 'Django>=4.2', 'sqlparse', 'autopep8', 'gprof2dot>=2017.09.19', diff --git a/silk/models.py b/silk/models.py index e86a31d6..94ed365d 100644 --- a/silk/models.py +++ b/silk/models.py @@ -26,20 +26,14 @@ from silk.config import SilkyConfig from silk.utils.profile_parser import parse_profile +from django.core.files.storage import storages +from django.core.files.storage.handler import InvalidStorageError try: - # New in Django 4.2 - from django.core.files.storage import storages - from django.core.files.storage.handler import InvalidStorageError - try: - silk_storage = storages['SILKY_STORAGE'] - except InvalidStorageError: - from django.utils.module_loading import import_string - storage_class = SilkyConfig().SILKY_STORAGE_CLASS or settings.DEFAULT_FILE_STORAGE - silk_storage = import_string(storage_class)() -except ImportError: - # Deprecated since Django 4.2, Removed in Django 5.1 - from django.core.files.storage import get_storage_class - silk_storage = get_storage_class(SilkyConfig().SILKY_STORAGE_CLASS)() + silk_storage = storages['SILKY_STORAGE'] +except InvalidStorageError: + from django.utils.module_loading import import_string + storage_class = SilkyConfig().SILKY_STORAGE_CLASS or settings.DEFAULT_FILE_STORAGE + silk_storage = import_string(storage_class)() # Seperated out so can use in tests w/o models