import re


def slugify(value):
    """Slugify string value.
    """
    value = re.sub(r'[\W_]+', '_', value)
    value = value.strip('_')
    value = value.lower()
    value = value[:63]  # Postgres limitation is 63
    return value