Based on https://github.com/JackStouffer/Flask-Foundation. Compatible with Flask 1.0
- Python 3+
- Flask 1.0+
- mysql
- all
packages
inrequirements.txt
cp .env.example .env
- Modify
.env
- Install mysql server and client
- Enable the mysql service
pip install -U -r requirement.txt
py.test tests
You will see the following summary after all tests finished.
==================== 7 passed, 21 warnings in 1.88 seconds ====================
flask db init
flask db migrate
flask db upgrade
flask run
flask db migrate
flask db upgrade
- Switch the config to
Prod
mode in.env
flask db init
flask run
apt install nginx
conda install -c conda-forge uwsgi libiconv
echo net.core.somaxconn= 4000 > /etc/sysctl.conf && sysctl -p
cp nginx/nginx.conf.example nginx/nginx.conf
vi nginx.conf # modify the config file
ln -s $PWD/nginx/nginx.conf.example /etc/nginx/conf.d/MY_APP.conf
cp uwsgi.ini.example uwsgi.ini
vi uwsgi.ini # modify the config file
uwsgi --ini uwsgi.ini