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.

Source Distribution

login-0.0.6.tar.gz (1.8 kB view details)

Uploaded Source

File details

Details for the file login-0.0.6.tar.gz.

File metadata

  • Download URL: login-0.0.6.tar.gz
  • Upload date:
  • Size: 1.8 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

Hashes for login-0.0.6.tar.gz
Algorithm Hash digest
SHA256 d3edf1e1a9ac26f43c4db7e2beb7649e411087f3a52f99a937740ba57f3d0e81
MD5 e5405c2246a6389b9cbe6adbe636613c
BLAKE2b-256 5fe7223a0b3f459de9475b97d85e8123f44beca6062fce78d008522d0aba7f28

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page