Closed nh916 closed 3 years ago
from decouple import Config, RepositoryEnv
DOTENV_FILE = '/opt/envs/my-project/.env'
env_config = Config(RepositoryEnv(DOTENV_FILE))
# use the Config().get() method as you normally would since
# decouple.config uses that internally.
# i.e. config('SECRET_KEY') = env_config.get('SECRET_KEY')
SECRET_KEY = env_config.get('SECRET_KEY')
I have a .env file that is in a different directory than the root directory and I noticed that python-decouple does not find it and only finds .env file if it is within the root directory. I was wondering how I can specify the path to my .env file