Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3992250
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T06:44:31+00:00 2026-05-20T06:44:31+00:00

My application uses Django’s login view from django.contrib.auth.views.login, with a custom template I made.

  • 0

My application uses Django’s login view from django.contrib.auth.views.login, with a custom template I made.

I’d like to pass my template an additional argument which will change the login page in a few ways. Actually, I’m trying to show a different login page based on the URL.

How can I pass additional arguments to the login’s view & to my custom template?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T06:44:32+00:00Added an answer on May 20, 2026 at 6:44 am

    The source shows there is only one place that would influence the template context.

    def login(request, template_name='registration/login.html',
              redirect_field_name=REDIRECT_FIELD_NAME,
              authentication_form=AuthenticationForm): # here
    

    So your only option is to hitch a ride on AuthenticationForm or write your own login view (which, by the way, is very simple if you look at the code).

    from django.contrib.auth.forms import AuthenticationForm
    
    AuthenticationForm.my_extra_data = 'foobar'
    
    (r'^accounts/login/$', 'django.contrib.auth.views.login', \ 
         {'template_name': 'myapp/login.html', \
          'authentication_form': AuthenticationForm }),
    

    Template

    {{ form.my_extra_data }}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Django application which liberally uses django.contrib.auth.decorators.login_required() and also django.views.decorators.http.require_http_methods() . The
I have a django application which uses a library.py file : library.py a=5 View
I have an application that uses Django 1.3 installed in python's site-packages. I want
My application uses a 3rd party dll. If I remove myapp.exe.local file from my
Our application uses SQL Server Reporting Services and allows users to add custom filters
My application uses Django non-rel . I don't have access to model. I have
I am writing a Python/Django web application that uses OAuth (for the TwitterAPI, not
I'm writing tests for a Django application that uses an external data source .
My Django application uses memcached via cmemcache. An issue sprung up when I was
I have a Django application that uses FileSystemStorage for development and S3BotoStorage for staging

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.