An implementation of the Underwater Hockey Tourist using Flask. See the live site at https://pucku.org/tourist/.
This page is for people who are interested in changing the code that runs the hockey tourist. If you'd like to improve our list of clubs please read https://pucku.org/tourist/about.
You can now run and modify your own instance entirely in the cloud! When logged into github go
to https://github.com/TomGoBravo/tourist-with-flask/ and look for the green <> Code
button.
Click on it, then Create codespace
. After about 20 seconds there should be terminal with a prompt
that looks like root@codespaces-60d6e9:/workspaces/tourist-with-flask#
. Run flask --debug run
, then look for the green Open in browser
button. When that opens you are connected to
your own private instance of the tourist. Explore and modify the source in the left panel, this
is a safe place to experiment.
If you can't use codespace to run an instance in the cloud, you can run the same container on your local machine.
docker compose -f .devcontainer/compose.yaml up
to start 3 containers: flask, the prefect
agent and prefect server.docker compose -f .devcontainer/compose.yaml run flaskdebugrun python -m pytest tourist/tests
docker compose -f .devcontainer/compose.yaml run prefectagentdev flask sync deploy-dataflow
tourist/
directory. The docker
container mounts this directory on your host machine inside the container. Some changes
trigger an automatic reload, others may need you to restart the container.Use this method if you are changing the dependencies or manually making a docker image.
First install pyenv. Don't miss pyenv Common-build-problems. Then try the following which works in debian 11:
PYTHON_CONFIGURE_OPTS="--enable-loadable-sqlite-extensions" pyenv install 3.10.7
pyenv virtualenv 3.10.7 tourist-3.10.7
pyenv activate tourist-3.10.7
python -m pip install pip==21.3 # Work around for https://github.com/jazzband/pip-tools/issues/1639
python -m pip install pip-tools
pip-sync
# Run tests
python -m pytest tourist/tests/
./.devcontainer/setup-dev-data.sh
# Start dev server
FLASK_APP=tourist flask --debug run