DEV Community

Discussion on: Django - How to keep secrets safe with python-dotenv

Collapse
 
paulwababu profile image
paulsaul621

This really helped me out! It is worth stating that if you have an application deployed, you should specify the path of the dot env on the settings file like so:

import os
from dotenv import load_dotenv
dotenv_path = os.path.join(os.path.dirname(__file__), '.env')
load_dotenv(dotenv_path)
Enter fullscreen mode Exit fullscreen mode
Collapse
 
earthcomfy profile image
Hana Belay

I'm glad you found it helpful. Thanks for the note too :)