Answers for "environment variables python .env"

21

dotenv python

# Install dotenv via:
pip3 install python-dotenv

# Load .env file using:
from dotenv import load_dotenv
load_dotenv()

# Use the variable with:
import os
os.getenv("ACCESS_KEY")
Posted by: Guest on May-09-2020
9

python create environment variable

import os
os.environ['variable_name'] = 'variable_value'
Posted by: Guest on April-28-2020
0

creating environment variable in python

ALLOWED_HOSTS=.localhost, .herokuapp.com
Posted by: Guest on July-08-2021

Code answers related to "environment variables python .env"

Python Answers by Framework

Browse Popular Code Answers by Language