Thursday, December 30, 2010

Re: Linux password authentication for django

On Thu, Dec 30, 2010 at 6:35 AM, Bill <> wrote:
Hi there,

I want to know is there any authentication module base on Linux passwd/
shadow file for django?

  import pam from django.contrib.auth.models import User 
class PamBackend:
    def authenticate(self, username=None, password=None):         # Check the username/password and return a User.         if pam.authenticate(username, password, service='login'):              try:                 return User.objects.get(username=username)             except User.DoesNotExist:                 pass         return None 

You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to
To unsubscribe from this group, send email to
For more options, visit this group at

No comments:

Post a Comment