GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Docs
  • About
  • Changelog
  • Newsletter
  • Trust GDPR
  • Pricing
  • Agents
  • Login
  • Contact
  • Docs
  • Install
  • Quickstart
  • Advanced
  • Node.js

This view

  • Original page
  • New address

GeezerVison is showing dotenvx.com — Encrypt a .env file in Python

Python

Encrypt a .env file in Python with the Dotenvx SDK, commit it safely, and load its secrets at runtime.

Install

Get the Dotenvx Python SDK.

$ pip install python-dotenvx

And the CLI to encrypt files.

$ curl -sfS https://dotenvx.sh | sh

Encrypt

Encrypt your .env file.

$ dotenvx encrypt

Inject

Then inject your encrypted secrets at runtime.

import os
from dotenvx import load_dotenv

load_dotenv()

print(f"HELLO: {os.getenv('HELLO')}")
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.