Tandoor Recipes, Part Two

Tandoor Recipes, Part Two
Photo by Alfred Kenneally / Unsplash

While poking around with Tandoor Recipes I noticed in the System screen a couple of warnings that I should probably address.

Media Serving
- Serving media files directly using gunicorn/python is not recommended! Please follow the steps described here to update your installation.Debug Mode
- This application is still running in debug mode. This is most likely not needed. Turn off debug mode by setting DEBUG=0 in the .env configuration file.PostegreSQL is not 16

Well let's just work through the list then.

Resolve Media Serving Warning

So reading about this issue at the link above pointed to files that no longer exist. So here is what I did to resolve this warning:

Steps performed on DOCKER-01

  • cd /apps/Tandoor-Recipes
  • sudo docker-compose down
  • sudo docker-compose pull
  • sudo docker-compose up -d

This warning has now been cleared.

Resolve Debug Mode Warning

Steps performed on DOCKER-01

  • sudo nano /apps/Tandoor-Recipes/.env
    • DEBUG=0
  • I save the .env file
  • sudo docker-compose down
  • sudo docker-compose up -d

This resolved the debug mode warning.

Resolve PostegreSQL is Not 16 Warning

Steps performed on DOCKER-01

  • sudo /usr/bin/tandoor-recipes
  • sudo docker-compose down
  • sudo mv postgresql/ postgresql.old/
  • sudo nano docker-compose.yml
  db_recipes:
    restart: always
    image: postgres:16-alpine
    volumes:
      - ./postgresql:/var/lib/postgresql/data
    env_file:
      - ./.env
  • I save the docker-cmopose.yml file
  • sudo docker-comopse pull
  • sudo docker-compose up -d
  • cat ~/tandoor.sql | sudo docker exec -i {{database_container}} psql postgres -U {{djangouser}}
  • cat ~/Backups/Tandoor-Recipes/Archive/home/david/Backups/Tandoor-Recipes/tandoor-recipes-db-2024-01-24.sql | sudo docker exec -i tandoor-recipes_db_recipes_1 psql postgres -U djangouser

The command errors out.

  • sudo docker exec -it tandoor-recipes_db_recipes_1 psql postgres -U djangouser
    • CREATE EXTENSION IF NOT EXISTS unaccent;
    • CREATE EXTENTION IF NOT EXISTS pg_trgm;
    • exit

Victory that took care of everything.