Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Login Session
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Denis Bahati  
View profile  
 More options Nov 6, 6:29 am
From: Denis Bahati <djma...@gmail.com>
Date: Fri, 6 Nov 2009 14:29:37 +0300
Local: Fri, Nov 6 2009 6:29 am
Subject: Login Session

Hi All
Am using my own table to let users login to my django site. I don like to
use django admin page, there fore i have created my model and a model form
to register users so that they can login using their username and password.

How can i utilize my function below so that every page is authenticated
using this file?

def mlogin(request):
    m = User.objects.get(username=request.POST['username'])
    if m.password == request.POST['password']:
        request.session['member_id'] = m.id
        #return HttpResponse("You're logged in.")
        return HttpResponseRedirect("/commTrack/")
    else:
        return HttpResponse("Your username and password didn't match.")

Or is there any script i can use? I have tried authenticating using the
AUTHENTICATION_BACKENDS but i didn't get it working. May be if there is one
to guide me on how i can set it.
Thanks in advance.
Regards
Denis


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Rama Vadakattu  
View profile  
 More options Nov 7, 7:26 am
From: Rama Vadakattu <rama.vadaka...@gmail.com>
Date: Sat, 7 Nov 2009 04:26:20 -0800 (PST)
Local: Sat, Nov 7 2009 7:26 am
Subject: Re: Login Session
You can simple use inbuilt user authentication provided by django.
What problem are you facing with it?

Any way if you are interested in building your own authentication
engine you need to do the following:
you can do this in several way one way is
1) Store cookie in user browser (you can store the user id (or) you
can give unique session id to this user and store relevant information
in the backend database)
      like :
       userid ============> sessionid
2) write down your middleware to check whether the request is bringing
any cookie associated with it or not.
   if yes pull the sessionid and  associate the request with this user
   if no means no user has logged in.

--rama

On Nov 6, 4:29 pm, Denis Bahati <djma...@gmail.com> wrote:


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google