I read tips for setting enviroment variables in python project and usually enviroment variables set in settings.py, but for Django project recommended to set environment valiables in wsgi.py and manage.py. What is advantages of this solution (instead of setting variables in settings.py)?
from dotenv import load_dotenv
# Load environment variables from .env file.
load_dotenv(verbose=True)
I use library python-dotenv and as lib description said
If you are using django you should add the above loader script at the top of wsgi.py and manage.py.