code: def create_user(**data):
      
      if 'username' not in data or 'password' not in data:
          raise ValueError('username and password are required.')
  
      # Hash the user password
      data['password'] = generate_password_hash(
          data.pop('password'),
          method='pbkdf2:sha256'
      )
  
      # Here you insert the `data` in your users database
      # for this simple example we are recording in a json file
      db_users = json.load(open('users.json'))
      # add the new created user to json
      db_users[data['username']] = data
      # commit changes to database
      json.dump(db_users, open('users.json', 'w'))
      return data
docs: Creates user with encrypted password