def create_token(self):

        token = unicode(
            hashlib.sha512(str(time.time()) + self.username).hexdigest())

        DataToken.delete_by_username(self.username, self.action)
        # create new one
        token_instance = DataToken.new(token, self.username, self.action)
        return token_instance
Create a time-stamped token
dataset/ETHPy150Open Net-ng/kansha/kansha/authentication/database/forms.py/TokenGenerator.create_token