Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Dealing with Secrets

Never ever hardcode snsitive information, especially when publishing it. Put whatever holds the secrets into .gitignore.

TOC:

Dotenv

L main.py
L .env
PASSWORD=password1234
import os # necessary
from dotenv import load_dotenv

load_dotenv('.env') # Loads into OS

password = os.getenv('PASSWORD') # Gets from the OS

(os.getenv("HOME") is Bash environmental variables $ env)

YAML