code for article pfeilbr/flask-playground
flask-playground
learn flask, the python web application framework
server.py
- flask serverclient.py
- http client. usesrequests
to POST theimage.jpeg
image 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
Twitter • Reddit