Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change login page to a variable setting #637

Closed
wants to merge 1 commit into from

Conversation

rgcarrasqueira
Copy link

the user wish to custom urls for two_factor and I think doing in this way could be more flexible

Description

creating a variable to receive the default condition, and If customized it at settings receive my new values

Motivation and Context

We cannot have hard code situations in a plugin

the user wish to custom urls for two_factor and I think doing in this way could be more flexible
@moggers87
Copy link
Collaborator

Users can already set login_view to whatever value they need either by overriding it in a sublcass or via as_view: https://docs.djangoproject.com/en/5.1/topics/class-based-views/#usage-in-your-urlconf

E.g.:

class ExampleView(OTPRequiredMixin, TemplateView):
    login_url = settings.LOGIN_URL

# or

ExampleView.as_view(login_url=settings.LOGIN_URL)

@moggers87 moggers87 closed this Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants