浏览代码

Adding __str__, putting dev server in debug mode

Kirk Trombley 5 年之前
父节点
当前提交
2cf2749b58
共有 2 个文件被更改,包括 6 次插入1 次删除
  1. 3 1
      server/app.py
  2. 3 0
      server/db.py

+ 3 - 1
server/app.py

@@ -12,6 +12,8 @@ def init_app():
     with open("secrets.toml") as infile:
         secrets = toml.load(infile)
     app.secret_key = secrets["secret_key"]
+    app.config["GROUP_PASS"] = secrets["group_pass"]
+    app.config["GOOGLE_API_KEY"] = secrets["google_api_key"]
     app.config["SQLALCHEMY_DATABASE_URI"] = secrets["db_uri"]
     app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
 
@@ -25,4 +27,4 @@ def init_app():
 
 
 if __name__ == "__main__":
-    init_app().run("0.0.0.0", 5000)
+    init_app().run("0.0.0.0", 5000, debug=True)

+ 3 - 0
server/db.py

@@ -5,3 +5,6 @@ db = SQLAlchemy()
 class Game(db.Model):
     game_id = db.Column(db.String, primary_key=True)
     timer = db.Column(db.Integer)
+
+    def __str__(self):
+        return f"Game({self.game_id}, {self.timer})"