def slugify(string):
    """
    Converts a string to a valid slug. For example::

        slugify('Hello World') -> 'hello-world'
    """
    if not string:
        return string
    string = re.sub(r'[^\w\s-]', '',
                    unicodedata.normalize('NFKD', de_camel(string, '-'))
                    .encode('ascii', 'ignore')
                    .decode('ascii')).strip()
    return re.sub(r'[-_\s]+', '-', string).strip('-').lower()
def slugify ( string ) : if not string : return string string = re . sub ( r'[^\w\s-]' , '' , unicodedata . normalize ( 'NFKD' , de_camel ( string , '-' ) ) . encode ( 'ascii' , 'ignore' ) . decode ( 'ascii' ) ) . strip ( ) return re . sub ( r'[-_\s]+' , '-' , string ) . strip ( '-' ) . lower ( )
Converts a string to a valid slug. For example::

        slugify('Hello World') -> 'hello-world'