A Microsoft-IVE project for PC donation
Support command line
-Initialization- Install Library
pip install -r requirements.txt
pip install azure-ai-formrecognizer --pre
Database initialization
flask db init
flask db migrate
flask db upgrade
Database reset
python reset_db.py
flask db upgrade
Insert required data
python insert_init_data.py
Export Library
pip freeze > requirements.txt
Enter vitual environment
. venv/bin/activate
Translation
Extract all the translated texts to the .pot file
pybabel extract -F babel.cfg -k _l -o messages.pot .
Generating a Language Catalog
pybabel init -i messages.pot -d app/translations -l zh
Updating - Please copy messages.po in app/translations
pybabel extract -F babel.cfg -k _l -o messages.pot .
pybabel update -i messages.pot -d app/translations
After Updating, Please Compile translation to activation translation Compile translation
pybabel compile -d app/translations
Commang-Line version
flask translate init LANG to add a new language
flask translate update to update all language repositories
flask translate compile to compile all language repositories
Update
Azure change prod branch azure login
az acr login --name pcdonation.azurecr.io
docker-compose up down push
docker-compose up --build -d
docker-compose down
docker-compose push
If you cannot migrate, please modify migrations/env.py .
target_metadata = models.db.Model.metadata
To reset Database
python reset_db.py && flask db upgrade && python insert_init_data.py