Check if your os.path.join(BASE_DIR, '.env') is resolving correctly. My guess is it's not reading the .env file correctly or not loading it.
os.path.join(BASE_DIR, '.env')