GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - falkben/zootable: Web app to tally zoo animals

BranchesTags
Open more actions menu

Latest commit

 

History

245 Commits
245 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docker
docker
 
 
mysite
mysite
 
 
scripts
scripts
 
 
staticfiles
staticfiles
 
 
templates
templates
 
 
test_data
test_data
 
 
tests
tests
 
 
zoo_checks
zoo_checks
 
 
.dockerignore
.dockerignore
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
.pyup.yml
.pyup.yml
 
 
LICENSE
LICENSE
 
 
Procfile
Procfile
 
 
README.md
README.md
 
 
codecov.yml
codecov.yml
 
 
deploy_notes.md
deploy_notes.md
 
 
docker-compose.yml
docker-compose.yml
 
 
dockerfile
dockerfile
 
 
fly.toml
fly.toml
 
 
manage.py
manage.py
 
 
pyproject.toml
pyproject.toml
 
 
requirements-dev.in
requirements-dev.in
 
 
requirements-dev.txt
requirements-dev.txt
 
 
requirements.txt
requirements.txt
 
 

Repository files navigation

Zootable

Build Status codecov

Web app to tally zoo animals. See zootable.com for information.

License

This project is licensed under the AGPLv3 license

Install

Docker

Build

docker build --pull --tag zootable .

Docker compose

Create a .env file for configured environment variables

docker compose up -d

To store the volume in a different default location (e.g. not on SD card when running on rpi), change the compose file:

volumes:
  postgres_data:
    driver: local
    driver_opts:
      type: none
      o: bind
      device: /mnt/ssd/data

If this is the first time starting the server, init the superuser:

docker compose exec web python manage.py createsuperuser

If you have a local database you'd rather use instead of the docker compose volume, you can use the following:

docker run --rm -p 8080:8080 \
  -v $(pwd)/.env:/home/appuser/.env \
  zootable

Debugging:

docker run --rm -it -p 8080:8080 \
  -v $(pwd)/.env:/home/appuser/.env \
  zootable /bin/bash

Local install

Database

Install postgres
  • sudo apt install postgresql postgresql-contrib libpq-dev python3.15 python3.15-dev
Config postgres
  • Start the database server

    • sudo service postgresql start
  • Login as postgres user

    • sudo -i -u postgres
  • Create database

    • createdb zootable
  • Create postgres zootable user

    • createuser --interactive
    • If don't make superuser, grant permissions to zootable
      • psql=# grant all privileges on database zootable to zootable;
  • Edit /etc/postgresql/16/main/pg_hba.conf and insert near the top

    local   all             zootable                                trust
  • Restart database: sudo service postgresql restart

App Setup

  • Create & activate virtual environment
    • uv venv .venv --seed
    • . .venv/bin/activate
  • Install
    • uv pip install -r requirements.txt && uv pip install -r requirements-dev.txt
    • uv pip install -e .
  • Create .env with required variables
  • Migrate database forward
    • python manage.py migrate
  • python manage.py createsuperuser
  • Upload data
    • python scripts/ingest_xlsx_data.py <DATA.xlsx>
    • Or upload xlsx file from within the app once running

Run

Standard

python manage.py runserver

Database actions

Database download

Proxy postgres server (fly.io) to localhost:

flyctl proxy 15432:5432 -a zootable-na-db

Dump the database to latest.dump:

note: need to have same version as server version (14.2)

PGPASSWORD=[PASSWORD] pg_dump -Fc --no-acl --no-owner -h localhost -p 15432 -v -U na_zootable zootable > latest.dump

Restore database from dump

  1. Drop local database before restore (optional):
    1. sudo -u postgres psql
    2. DROP DATABASE zootable;
    3. CREATE DATABASE zootable;
  2. Restore from the dump
    1. pg_restore --verbose --clean --no-acl -p 5432 --no-owner -U zootable -d zootable latest.dump

Deployment check

https://docs.djangoproject.com/en/2.2/howto/deployment/checklist/

python manage.py check --deploy

Test

  1. Run from root directory. Pytest settings in pytest.ini.

    pytest

  2. For coverage, coverage settings are in .coveragerc and run:

    pytest --cov=zoo_checks --cov-report=xml

Dependencies

Python dependencies

Create a lock file

To generate compiled dependencies (requirements.txt and requirements-dev.txt):

uv pip compile -o requirements.txt --generate-hashes pyproject.toml --quiet && \
uv pip compile -o requirements-dev.txt --generate-hashes requirements-dev.in --quiet

Upgrade dependencies

uv pip compile -o requirements.txt --generate-hashes pyproject.toml --quiet --upgrade && \
uv pip compile -o requirements-dev.txt --generate-hashes requirements-dev.in --quiet --upgrade

To upgrade to a new django version, edit the pyproject.toml file and then run the upgrade compile command above.

Install into local environment

uv pip install -e . -r requirements.txt

For dev

uv pip install -e . -r requirements.txt -r requirements-dev.txt

About

Web app to tally zoo animals

zootable.com

Resources

Readme
AGPL-3.0 license
Activity

Stars

4 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.