I tried to load environment variables from a file named .env to settings.py file here i created the .env file and settings file same folder.
this is my .env file >
For future Googlers here's another approach. Inside manage.py add:
manage.py
from dotenv import load_dotenv load_dotenv()
Now you can do the following anywhere else in your project (including settings.py) to get access to environment variables:
settings.py
import os os.environ.get("NAME")