From 3a61e5c73868ccfbcc02afd6f8e4df5e97750a5d Mon Sep 17 00:00:00 2001 From: Jhondale Date: Mon, 1 Jul 2024 23:48:34 +0800 Subject: [PATCH] Deploy flask app using waitress. --- .gitignore | 1 + app.py | 5 +++-- requirements.txt | Bin 236 -> 236 bytes run.bat | 1 + 4 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 run.bat diff --git a/.gitignore b/.gitignore index e424a52..928c614 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +__pycache__ attendance/ faces/ test_faces/ diff --git a/app.py b/app.py index 17d4bdb..02bf6f6 100644 --- a/app.py +++ b/app.py @@ -16,6 +16,7 @@ from cryptography.fernet import Fernet from facenet_pytorch import InceptionResnetV1 from flask import Flask, render_template, Response, request, jsonify, send_file +from waitress import serve app = Flask(__name__) camera = None @@ -471,5 +472,5 @@ def write_password(encrypted_password): with open(PASSWORD_FILE, 'wb') as file: file.write(encrypted_password) -if __name__ == '__main__': - app.run(host='0.0.0.0',port=5000,debug=False) +# if __name__ == '__main__': +# app.run(host='0.0.0.0', port=3000, debug=False) \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 64a9958315d7cfdbde6d587b82200eb451cfddef..5da3e80587a4755689f0228b8c3f57d0a92c6f0b 100644 GIT binary patch delta 25 gcmaFE_=ZvN|G#pEM21X;5{4p%REA=P;)#N{0eu(<*Z=?k delta 25 gcmaFE_=ZvN|G#vGQieQ+Oon8Je1;;1yorLh0eqSW%K!iX diff --git a/run.bat b/run.bat new file mode 100644 index 0000000..4adca34 --- /dev/null +++ b/run.bat @@ -0,0 +1 @@ +waitress-serve --listen=127.0.0.3:3000 app:app \ No newline at end of file