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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:43:36+00:00 2026-05-29T12:43:36+00:00

My application provides 2 ways to login into website (same page). First is username

  • 0

My application provides 2 ways to login into website (same page). First is username & password and other is username & emergency password. I have backend.py as

class PersonAuthenticationBackend(object):
  def authenticate(self, username=None, password=None):
    try:
      person = User.objects.get(username=username)
      if person.check_password(password):
        return person
      else:
        try:
          db_ecode=person.get_profile().u_emergency_code
          if password==db_ecode:
            print "EMERGENCY LOGIN"
            return person
          else :
            return None
        except:
          return None
    except User.DoesNotExist:
            pass
    return None

    def get_user(self, user_id):
      try:
          return User.objects.get(pk=user_id)
      except User.DoesNotExist:
          return None

Now how do I know if user has logged in using emergency login ??

  • 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-29T12:43:44+00:00Added an answer on May 29, 2026 at 12:43 pm
    person.a = lambda: None
    setattr(person.a, 'login', True)
    

    and then,
    retrive using

    print "person.a %s"%person.a.login
    

    and then store it in session.

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

Sidebar

Related Questions

I have an application that provides core services for a series of other applications.
I have a web application which provides Excel files via IE 7. It requests
I have a C application which provides a shell for entering commands. I'm trying
Android provides some ways to save application information. http://developer.android.com/guide/topics/data/data-storage.html Now, my issue is that
.NET provides EventLog class that be able to write application event information to a
I'm writing an application where a user provides a connection string manually and I'm
From PyPubSub : Pypubsub provides a simple way for your Python application to decouple
I use XFire to create a webservice wrapper around my application. XFire provides the
Most of you have probably bumped into a situation, where multiple things must be
I have tried some ways to use LINQ dynamic queries - LINQKit and LINQ

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.