# facial-recognition-web **Repository Path**: bukcn/facial-recognition-web ## Basic Information - **Project Name**: facial-recognition-web - **Description**: No description available - **Primary Language**: Python - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2024-09-07 - **Last Updated**: 2024-12-03 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 功能 - 此模块为facial-recognition-demo的UI模块,与facial-recognition-core一起构成了facial-recognition-demo. # 虚拟环境 - 创建虚拟环境 - python3 -m venv .venv - 激活虚拟环境 - . .venv/bin/activate - source .venv/bin/activate # 包 - pip install Flask -i https://pypi.tuna.tsinghua.edu.cn/simple - pip install gunicorn -i https://pypi.tuna.tsinghua.edu.cn/simple - pip install flask-sqlalchemy -i https://pypi.tuna.tsinghua.edu.cn/simple - pip install flask-migrate -i https://pypi.tuna.tsinghua.edu.cn/simple - pip install flask-apscheduler -i https://pypi.tuna.tsinghua.edu.cn/simple - pip install pyyaml -i https://pypi.tuna.tsinghua.edu.cn/simple - pip install urllib3 -i https://pypi.tuna.tsinghua.edu.cn/simple - pip install orjson -i https://pypi.tuna.tsinghua.edu.cn/simple - pip install flask-login -i https://pypi.tuna.tsinghua.edu.cn/simple ## 测试包 - pip install pytest coverage -i https://pypi.tuna.tsinghua.edu.cn/simple - pip install pytest-ordering -i https://pypi.tuna.tsinghua.edu.cn/simple # Run - Remember, you should still be in the top-level directory, not the app package. - source .venv/bin/activate - flask --app src.app run --host 0.0.0.0 - flask --app src/hello run - flask --app hello run --debug - flask --app src/main run --debug - gunicorn -w 1 -b 0.0.0.0:5000 src.app:app -D - --reload : 文件变化自动加载 - -D : 后台运行 # 数据库 - flask --app src/main db init - flask db init 在migrations目录下生成迁移脚本 - flask db migrate 生成迁移脚本 - flask db upgrade 把改动应用到数据库中 - flask -e testing.env db upgrade # 指定环境变量 - testing.env中的内容是FLASK_DEVOPS_ENV=testing键值对,用于定义环境变量