Skip to content

Commit

Permalink
Avoid triggering django.setup() when importing settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
koniiiik committed Oct 17, 2024
1 parent 637cf97 commit 5b65255
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/drf_yasg/app_settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from django.conf import settings
from django.utils.functional import lazystr
from rest_framework.settings import perform_import

SWAGGER_DEFAULTS = {
Expand Down Expand Up @@ -49,7 +50,7 @@
}
},
'SECURITY_REQUIREMENTS': None,
'LOGIN_URL': getattr(settings, 'LOGIN_URL', None),
'LOGIN_URL': lazystr(lambda: getattr(settings, 'LOGIN_URL', None)),
'LOGOUT_URL': '/accounts/logout/',
'SPEC_URL': None,
'VALIDATOR_URL': '',
Expand Down

0 comments on commit 5b65255

Please sign in to comment.