Google App Engine get_current_user always return None, even if i'm logged
===

here's my code

     def subscribe_current_user(self):
            user1 = SocialNodeSubscription(parent=self.key)
            user1.subscribed = True
            current_user = users.get_current_user()
            logging.error(current_user)
            if current_user:
                user1.user=current_user
            else:
                raise users.UserNotFoundError
            
            user1.put()

The problem is that get_current_user returns None even if i'm logged in. It stores a None in the field user1.user and it prints a None in the log console. 

How can i solve that?