Asked about Environments, packaging and tooling

How do you handle secrets such as API keys?

An answer that works

Keep them in environment variables, loaded from a .env file that is gitignored, and read at runtime. Never commit them. In production they come from the platform's secret store rather than a file.

Reading an answer is not being able to give one. The section that teaches this is Environments, packaging and tooling, 4 hours of Python.

Learn this properly