【问题标题】:how to make a system in python that support limited users? for instance, it should support 200 users如何在 python 中创建一个支持有限用户的系统?例如,它应该支持 200 个用户
【发布时间】:2022-11-30 18:11:34
【问题描述】:

如何限制用户注册量?一个应该支持有限数量用户的系统?我们该怎么做?请有人建议教程、网站或任何好的资源。

我试着搜索它,但我在互联网上找不到任何有用的东西

【问题讨论】:

    标签: python


    【解决方案1】:

    您提供的信息有点不够,但是您的意思是在新注册之前对注册用户进行检查吗?

    是这样的吗?

    def check_max_users(db_connection):
      users_count = db_connection.query("SELECT COUNT(*) AS users_count FROM users").first().users_count
      if users_count > 200:
        raise MaxUsersError()
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-09
      • 1970-01-01
      • 1970-01-01
      • 2012-03-20
      • 2015-12-13
      相关资源
      最近更新 更多