The error you receive indicates that there is an issue with the formatting of your .env file. In an nutshell (as @OlafdeL mentioned) for pydantic greater than 2.0.0:
from pydantic_settings import BaseSettings
class EnvSettings(BaseSettings):
allowed_hosts: list[str]
and then your .env should look like this:
ALLOWED_HOSTS='["host-1", "host-2"]'