code: def basic_register(username, password, password2):
      
      if password != password2:
          raise InvalidInput(password={'message': "Passwords do not match"},
                             username={'value': username})
      user = User.objects.create_user(username, password)
      return create_session(user.username, password)
docs: Register a user and session, and then return the session_key and user.