Very simple question. When using the login_required decorator above a view, the authentication system redirects me to whatever URL is defined in LOGIN_URL in settings.py, using the template found in registration/login.html.
The question: How can I define a different template name for my login form (I don't want to use the default)?
login documentation:
If you’d prefer not to call the template
registration/login.html, you can pass thetemplate_nameparameter via the extra arguments to the view in your URLconf. For example, this URLconf line would usemyapp/login.htmlinstead:
(r'^accounts/login/$',
'django.contrib.auth.views.login',
{'template_name': 'myapp/login.html'}),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With