These instructions and scripts have been tested on macOS (aka Mac OS X) and Linux with Python installed.
With pyenv to manage python versions, and virtualenv to isolate your packages, you can optionally create a project area.
# Optional Setup w/ PyEnv + VirtualEnv
VERSION=$(cat .python-version)
pyenv install $VERSION
pyenv virtualenv $VERSION 'flask-test'
pyenv activate 'flask-test'
# Install Required Packages
pip install -r requirements.txt
# Run Server
./app.py &
# Manually Test
curl -i localhost:5000/
curl -i localhost:5000/hello/Simon
# Start containerized service on Docker
docker-compose up -d
# Determine Guest is native Docker, Docker-Machine or Docker-Desktop
[ -z ${DOCKER_MACHINE_NAME} ] || WEBSERVER=$(docker-machine ip ${DOCKER_MACHINE_NAME})
WEBSERVER=${WEBSERVER:-localhost}
# Manually Test
curl -i $WEBSERVER:5000/
curl -i $WEBSERVER:5000/hello/Simon
# Start containerized service on Vagrant/Virtualbox guest
vagrant up
# Manually Test
curl -i localhost:5000/
curl -i localhost:5000/hello/Simon
./test.py
- Python Web Microframework
- Testing
- Python Environment
- python - language versions
- pyenv - manage python versions
- virtualenv to isolate packages with both Python 2 and Python 3.