Move calls to get_settings outside of __init__ of the auth backend, the middleware and the authentication request view.
Why?
Because if you want to overwrite get_settings, to for example use some session data (and therefore the request object), it's impossible now. The request is not known inside the __init__ (of views, middleware and auth backends) yet. You have to do some hacks to get it working. (overwriting the __init__..)
(I ran into this when I tried to support multiple providers, where the chosen provider is in the session)
Proposal
Move calls to
get_settings
outside of__init__
of the auth backend, the middleware and the authentication request view.Why?
Because if you want to overwrite
get_settings
, to for example use some session data (and therefore the request object), it's impossible now. The request is not known inside the__init__
(of views, middleware and auth backends) yet. You have to do some hacks to get it working. (overwriting the__init__
..)(I ran into this when I tried to support multiple providers, where the chosen provider is in the session)