xxxxxxxxxx
# Install dotenv via:
pip3 install python-dotenv
#in views.py
# Load .env file using:
from dotenv import load_dotenv
load_dotenv()
# Use the variable with:
import os
os.getenv("ACCESS_KEY")
xxxxxxxxxx
"""
create a file in local directory
touch .env
add entries with following format:
SECRET_KEY=secret_token_here
"""
from dotenv import load_dotenv
import os
# By Default below line will load a file ".env" in current working directory
load_dotenv()
secret_key = os.getenv('SECRET_KEY')
print(secret_key)