Tech
DEBUG=false but my app still runs in debug mode: why an environment variable "false" is true
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...
Read the full discussion on Dev.to
This article was aggregated from Dev.to. Click to join the conversation.
View on Dev.to