Flask
1 min read
flask
Written in 2020. Tools, APIs and prices may have changed since.
Lab note What I wrote down while learning this by building with it. Short by design; the code is in pfeilbr/flask-playground.
learn flask, the python web application framework
server.py- flask serverclient.py- http client. usesrequeststo POST theimage.jpegimage fileload-test.sh- load test via parallel requests
Prerequisites
- pipenv for python environment/packages
Running
# install all dependencies
pipenv install --dev
# load python enviroment
pipenv shell
# run server in debug (livereload - reload on file changes) mode
FLASK_DEBUG=1 FLASK_RUN_PORT=5000 FLASK_APP=server.py flask run
# run client
python client.py
# load test
chmod +x load-test.sh
./load-test.sh