You didn’t call read_env
method of Env class, so I guess variables from your .env file weren’t load. You have to add parenthesis so it will look like this env.read_env()
to make function call and actually read variables.
Also it is sometimes good idea to provide default value for secrets, DEBUG = env.bool("DEBUG", True)
Then you don’t need to specify debug in .env file on local but have to add it on production or in reverse.