Yeah, that's an unfortunate drawback of dotenv. There's a couple of things you can do.
Explicitly check for a string value. DEBUG = (os.getenv("DEBUG") == 'true')
Cast the val to a boolean DEBUG = bool(os.getenv("DEBUG")), and use an empty string to denote a false value DEBUG=''.
Use a more fully-featured package like django-environ. There's slightly more configuration required, but if your project has multiple boolean settings it might be worth it. (I haven't actually used django-environ, but it looks pretty interesting so I may investigate).
Yeah, that's an unfortunate drawback of dotenv. There's a couple of things you can do.
DEBUG=''
.thanks for this