Install Auth Packages
Exit

Install Auth Packages

Install passlib and python-jose for password hashing and JWT tokens

💻

Writing code and entering commands is only available on desktop. Open this page on a larger screen to complete this chapter.

What you are installing

This course requires two new packages. Each handles one half of the authentication system:

PackagePurpose
passlibPassword hashing library. The [bcrypt] extra installs the bcrypt algorithm — the industry standard for hashing passwords.
python-joseJSON Web Token (JWT) library. The [cryptography] extra installs the cryptography backend for signing tokens.

After installing, verify that both packages load correctly by importing their key classes.

Instructions

Install the authentication packages and verify the installation.

  1. Run pip install "passlib[bcrypt]" "python-jose[cryptography]".
  2. Verify by running python -c "from passlib.context import CryptContext; from jose import jwt; print('Ready')".