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_salt("__YOUR_SECRET_PLAINTEXT__")
# signin
username = 'ksg97031'
password_hash = generate_password_hash(password)
user = User(username, password_hash)
db.session.add(user)
db.session.commit()
# login
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.
Source Distribution
login-0.0.3.tar.gz
(1.4 kB
view details)
File details
Details for the file login-0.0.3.tar.gz.
File metadata
- Download URL: login-0.0.3.tar.gz
- Upload date:
- Size: 1.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9060ca92b34e3109109f9ff52e656a20386436dce7753c3922a9d0f939e53d18
|
|
| MD5 |
704c8c029850de46efa32585996923fe
|
|
| BLAKE2b-256 |
9b5385f7b788ffaefb83c317a421a4c4a4cb8edd691f83cf904dd227eddc7b38
|