From 7d21736ff60c590c9f0531c7c53b7e2d0f46417e Mon Sep 17 00:00:00 2001 From: Angus Holder Date: Fri, 26 Apr 2024 17:35:10 +0100 Subject: [PATCH] Avoid importing `django.test` in main code `setting_changed` is actually from `django.core.signals`, and is re-exported from `django.test.signals`. `django.test` takes 20-40ms to import, so not too much, but it's an easy win to avoid this import. --- knox/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knox/settings.py b/knox/settings.py index d1b09347..a2c3d9c8 100644 --- a/knox/settings.py +++ b/knox/settings.py @@ -1,7 +1,7 @@ from datetime import timedelta from django.conf import settings -from django.test.signals import setting_changed +from django.core.signals import setting_changed from rest_framework.settings import APISettings, api_settings USER_SETTINGS = getattr(settings, 'REST_KNOX', None)