Skip to main content

Module for common login service

Project description

Module for common login service
$ pip install login
from login import generate_password_hash, check_password_hash, set_salt

# set into config script
set_salt("__YOUR__SECRET__KEY__")

# set into sign-in script
username = 'ksg97031'
password_hash = generate_password_hash(password)
user = User(username, password_hash)
db.session.add(user)
db.session.commit()

# set into login script
login_username = 'ksg97031'
user = User.query.filter(User.name == login_username).first();
assert user is not None
if not check_password_hash(password, user.password):
    return 'Login Fail'

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for login, version 0.0.6
Filename, size File type Python version Upload date Hashes
Filename, size login-0.0.6.tar.gz (1.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page