Back to Browse

Master Python Environment Variables in Under 15 Minutes

951 views
Mar 28, 2023
13:36

In this video tutorial we will learn how to use an env variables file (.env) in Python with the help of a package called python-dotenv. python-dotenv is a package that helps you load secret variables from a file into your application without contaminating your git history with sensitive information. We will load our environment variables from a secrets file and also talk about some best practices when working with .env files. Chapters: 0:00 Intro 0:56 Initialise poetry project 1:10 Install python-dotenv 1:40 Activate virtual environment 1:46 Install dependencies 2:01 Load .env 3:03 Create.env 5:07 Read variables from .env 9:00 Variable interpolation 11:44 Remember to add .env to .gitignore 12:10 .env.example Code: https://github.com/demoskp/python-dotenv-tutorial Personal website: http://www.petsas.consulting

Download

0 formats

No download links available.

Master Python Environment Variables in Under 15 Minutes | NatokHD