AOriginal post
Rank 2: Process
Hello!
I am trying to include an env. variable, but the execution fails. Do you have any idea what is wrong?
async def process_file(file):
try:
allowed_extensions = os.getenv("ALLOWED_EXTENSIONS", "").split(",")
if not allowed_extensions:
raise ValueError("ALLOWED_EXTENSIONS not set")
if file["type"] == "file" and file["name"].lower().endswith(
(tuple(allowed_extensions))
):
Summary
Developers are trying to include an environment variable in their code, however, the execution fails. The problem might be the environment variable not being set. Make sure to set it properly.