You put DEBUG=false in .env , restart, and the app is still in debug mode. If you have searched "environment variable false is true" or "os.getenv boolean", here is the whole explanation: an environment variable is always a string, and "false" is a non-empty string, so it is truthy. Python's os.getenv , Node's process.env and Vite's import.meta.env all hand you text, never a bool or a number. DEBUG = bool ( os . getenv ( " DEBUG " )) # True for DEBUG=fals...