Skip to content

Instantly share code, notes, and snippets.

@mansha99
Last active July 8, 2023 11:53
Show Gist options
  • Save mansha99/ae186dbd0a0599555219d264e47e9e0c to your computer and use it in GitHub Desktop.
Save mansha99/ae186dbd0a0599555219d264e47e9e0c to your computer and use it in GitHub Desktop.
settings.py
import os
import environ #add this
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Add All lines given below
env = environ.Env(
DEBUG=(bool, False)
)
environ.Env.read_env(os.path.join(BASE_DIR, '.env'))
# MESSAGE variable is getting its value from .env file
MESSAGE=env('SECRET_MESSAGE')
#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment