Create a SHA1 hash based on the KEY and action string

def create_securityhash(action_tuples):
    """
    Create a SHA1 hash based on the KEY and action string
    """
    from settings import SECRET_KEY

    action_string = "".join(["_%s%s" % a for a in action_tuples])
    security_hash = sha1(action_string + SECRET_KEY).hexdigest()
    return security_hash