A web page that generates statistics and graphs for a family game called Møkkis, which is a 6-athlon card game.
The web page is created using the python web framework Django, which generates jQuery Mobile pages. It also contains small amounts of custom JavaScript code, mostly to generate graphs with jqPlot (http://www.jqplot.com/).
The project is hosted on Google App Engine Standard Environment.
Find it here: https://mokstats.appspot.com/
- Setup python env
- Install python 3.13.*
- Setup python env
cd backend pip install poetry poetry sync
- Configure PyCharm
- Install PyCharm
- Verify poetry and print env paths
cd backend poetry check poetry env info
- PyCharm > Settings > Project: untitledgame > Python Interpreter > Add > Select Existing > Python > [Virtual.Executable from previous step]
- Restart PyCharm, start a terminal and verify poetry terminal context
- PyCharm > Settings > Lange & Frameworks > Django >
- Tick "Enable Django Support"
- Tick "Do not use Django test runner"
- Setup database
- Install Docker Desktop
- Start docker container
docker run --name mokstats-postgres -p 5432:5432 -e POSTGRES_USER=mokstats -e POSTGRES_PASSWORD=mokstats -e POSTGRES_DB=mokstats -d postgres:17
- Migrate and populate database
cd backend poetry shell python manage.py migrate python manage.py createcachetable
- (Verify) Run tests
pytest . - (Verify) Run lints:
.\lint.ps1 - (Optional) Setup pre-commit:
cp pre-commit.sh .git/hooks/pre-commit
Populate data from prod
Run the content of populate.sql in a console connected to the database.
Make an admin
python manage.py createsuperuser --username admin --email foo@foo.foo- Test it by going to http://127.0.0.1:8000/admin
Sync dependencies
poetry update --sync
Run linters
.\lints.ps1
Configure secrets
Deploy with GitHub action
Deploy can be manually triggered through a GitHub action. Se .github/workflows/deploy.yml.
Check deployed files to app engine
- Find latest version here: https://console.cloud.google.com/appengine/versions?serviceId=default&hl=en&project=mokstats
gcloud app versions describe --service=default "20250613t004846"