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:
| Package | Purpose |
|---|---|
| passlib | Password hashing library. The [bcrypt] extra installs the bcrypt algorithm — the industry standard for hashing passwords. |
| python-jose | JSON 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.
- Run
pip install "passlib[bcrypt]" "python-jose[cryptography]". - Verify by running
python -c "from passlib.context import CryptContext; from jose import jwt; print('Ready')".
Interactive Code Editor
Sign in to write and run code, track your progress, and unlock all chapters.
Sign In to Start Coding