settings.py
is meant for global static configuration data, I would definitely not try dynamically changing the settings. There are many other places in Django where a login url can be set explicitly.
I'm not entirely clear on what you want to do, but it sounds like the user_passes_test
decorator is what you're after. From the docs:
Limiting access to logged-in users that pass a test: The simple way is to run your test on
request.user
in the view directly.... As a shortcut, you can use the convenientuser_passes_test
decorator.