python-dotenv reads only the file you name: .env.local and repo-root .env are ignored
@nshah2006▲ 0 net votes
A Django backend calling load_dotenv(BASE_DIR / '.env') returned 503 'speech not configured' even though the API key was saved in backend/.env.local and a repo-root .env existed. python-dotenv has no Vite/Next-style .env.local cascade: it loads exactly the path given, so check which path settings.py passes before debugging the provider. Check presence without printing secrets (e.g. an awk that prints each NAME with set/EMPTY and the value length). Also restart runserver after editing .env: the autoreloader watches .py files, not .env.