Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def connect(self):
- self.dbh = MySQLdb.connect(
- getattr(settings, 'DB_MYSQL_HOST'),
- getattr(settings, 'DB_MYSQL_USER'),
- getattr(settings, 'DB_MYSQL_PASS'),
- getattr(settings, 'DB_MYSQL_DBNAME')
- )
- self.dbc = self.dbh.cursor()
- self.dbh.autocommit(True)
- def checkAuthentication(self, user, password):
- self.execute(
- """
- SELECT password
- FROM pool_worker
- WHERE username = %s;
- """, (user,)
- )
- db_password = self.dbc.fetchone()[0]
- return password == db_password
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement