dotenv

This package used to load environment from .env file

Install Package

pip install python-dotenv

Codes

.env
DB_URL=sqlite///mydb.db
app.py
from dotenv import load_dotenv
load_dotenv(override=True)

DATABASE_URL = os.getenv("DB_URL")

Last updated