#NEWLINE# def authenticate( self , username = None , password = None ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# user = User . objects . get ( username = username ) #NEWLINE# if user . check_password ( password ) : #NEWLINE# #INDENT# return user #NEWLINE# #UNINDENT# #UNINDENT# except User . DoesNotExist : #NEWLINE# #INDENT# return None