def slugify_unicode(s):
 chars = []
 for char in str(smart_text(s)):
  cat = unicodedata.category(char)[0]
  if ((cat in u'LN') or (char in u'-_~')):
   chars.append(char)
  elif (cat == u'Z'):
   chars.append(u' ')
 return re.sub(u'[-\\s]+', u'-', u''.join(chars).strip()).lower()

def slugify_unicode ( s ) : chars = [ ] for char in str ( smart_text ( s ) ) : cat = unicodedata . category ( char ) [ 0 ] if ( ( cat in u'LN' ) or ( char in u'-_~' ) ) : chars . append ( char ) elif ( cat == u'Z' ) : chars . append ( u' ' ) return re . sub ( u'[-\\s]+' , u'-' , u'' . join ( chars ) . strip ( ) ) . lower ( )
replacement for djangos slugify which allows unicode chars in slugs .