def as_list(value):
    if isinstance(value, list):
        return value
    return [
        x.strip()
        for x in value.split(',')
        if x.strip()
    ]
Smart cast value to list by splittng the input on ",".
dataset/ETHPy150Open funkybob/django-classy-settings/cbs/utils.py/as_list