pip3 freeze > requirements.txt
#activate venv
python3 -m venv directory-name
cd directory-name/
source bin/activate
pip install -r requirements.txt
#deactivate venv
deactivate
For Linux Environments
# in virtual environemnts create . env file
touch .env
# Now save your secret
export KEY="mysecretkey_12345"
# Save this file in vevn
source .env
import os
os.environ.get("KEY")