covid-19-detector/README.md
2024-08-01 13:28:09 +08:00

30 lines
1006 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 如何运行?
1.pip install -r requirements.txt
2.配置数据库在config.py文件中(项目根目录下),SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://root:123456@localhost/covid_detector'
默认mysql的端口为3306 root:123456 分别是用户名 密码 covid_detector 是数据库
3.使用navicat创建covid_detector数据库与代码中保持一致
4.可以先删除migrations文件夹然后conda activate激活环境在命令行输入
1. set FLASK_APP=flaskapp.py
2. flask db init
3. flask db upgrade
以上步骤结束会在数据库中创建若干空表
2.命令行输入 run.bat
3.浏览器输入http://127.0.0.1:5000/即可访问主页。
docker部署
windows环境和linux环境有两个不同之处主要是因为windows的命令行和linux的bash不同命令不同
区别在于linux需要
1. 确保 run.sh 文件具有执行权限
RUN chmod +x /app/run.sh
2. 指定容器启动时运行的命令
CMD ["./run.sh"]
Dockerfile文件需要区别