def slugify(value):
    """
    Normalizes string, converts to lowercase, removes non-alpha characters,
    and converts spaces to hyphens.
    """
import unicodedata
value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore')
value = str(re.sub('[^\\w\\s-]', '', value).strip().lower())
value = str(re.sub('[-\\s]+', '-', value))
Turn a string into a valid filename?