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 8043029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T04:46:45+00:00 2026-06-05T04:46:45+00:00

I am using the builtin login module to perform logins in my website url(r’^login/$’,

  • 0

I am using the builtin login module to perform logins in my website

url(r'^login/$', 'django.contrib.auth.views.login', {'extra_context': {'page_name': 'login'}),

and this is the next action of my login form

<input type="hidden" name="next" value="/redirect/">

During registration I create a small tracking code for the user like this:

host = request.META.get('HTTP_X_FORWARDED_FOR','') or request.META.get('REMOTE_ADDR')
if tid == '0':
    import os, binascii
    tid = binascii.hexlify(os.urandom(6))
ut = UserTracking.objects.create(user=user, username=username, tracking_id=tid, remote_host=host, action='register')
ut.save()
variables = RequestContext(request, {'username': form.cleaned_data['username'], 'email': form.cleaned_data['email'], 'message': message, 'tid': tid})
return render_to_response('registration/register_success.html', variables)

In the register_success.html I use a jquery plugin to save my tracking code into the user’s pc like this:

$.jStorage.set('tid', '{{ tid }}');

How can I add this code to my login form and send in with username and password to my views.py?

  • 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-06-05T04:46:46+00:00Added an answer on June 5, 2026 at 4:46 am

    You might need to customize the login view.

    1. Add your login view:

      url(r’^login/$’, ‘myapp.account.views.login’, {‘extra_context’: {‘page_name’: ‘login’})

    Then in your myapp/account/views.py, add:

    def login(request, template_name='logintemplate.html'):
    
        if (request.POST):
            username = request.POST.get('username', None)
            password = request.POST.get('password', None)
            tracking_code = request.POST.get('tracking_code', None)
            user = authenticate(username=username, password=password)
    ......
        if user:
            # your custom code here
    ......
    

    and in logintemplate.html add the tracking code into the login form.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently, this is how I do my login: (r'^login/?$','django.contrib.auth.views.login',{'template_name':'login.html'}), I'm using Django's built in
I need to secure my website without using the ASP.NET built in login controls
I have managed to make my URL i18n compliant using Zend_Controller_Router . Ie: en/user/login
I've implemented a notification bar using django.contrib.messages . Now, I want to make extended
I'm currently developing an ASP.NET website, and I'm using ASP.NET's built-in Login control with
I'm using the Facebook PHP API to allow logins into my website. I am
I am using the matches string builtin and need to run a regex pattern
I am using built in Drupal 6 user module, fore user registration, forgot-your-password-emails and
I am using the built in comment system with Django but it has started
I am trying to get a login form I have in django to only

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.