Skip to content

j3rrryy/school_464

Repository files navigation

School website

Python 3.12 MIT License Black formatter

📖 Key features

  • RSS
  • PWA
  • Dynamic menu
  • Dynamic footer
  • Uses PostgreSQL
  • Supports XML maps
  • Custom error pages
  • Supports caching (Redis)
  • Easy editing of HTML pages
  • Version for the visually impaired
  • Automatic conversion of images to WebP
  • Automatic cleaning of unused media files

💻 Requirements

  • Docker

🛠️ Getting started

  • Create .env.dev file with variables as in the file in the examples/docker/env/ folder, then put it in the docker/env/ folder

  • (For prod) Create .env.prod file with variables as in the file in the examples/docker/env/ folder, then put it in the docker/env/ folder

  • (For prod) Create django.conf file with your data as in the examples/docker/nginx/prod/ folder, then put it in the docker/nginx/prod folder

  • (For prod) Create docker-compose.yml file with your data as in the examples/ folder, then put it in the / folder

🚀 Start

  • Run the dev build

    docker compose -f docker-compose.dev.yml up --build -d
  • Run the prod build and get a SSL certificate

    • Build the project

      docker compose build
    • Start Docker and get a certificate

      docker compose up nginx certbot
    • Stop your containers to continue

      docker compose stop
    • Comment out the command in docker-compose.yml

      command: certonly --webroot --webroot-path=/var/www/certbot/ --email <your_email> --agree-tos --no-eff-email -d <domain (example.com)> -d <domain (www.example.com)>
    • Uncomment the part of nginx config in docker/nginx/prod/django.conf

    • Start Docker again

      docker compose up -d
    • Run the setup script

      ./setup.sh

👷 Maintenance

  • Create superuser

    • Get access to the container

      docker exec -it <container_name> sh
    • Press Ctrl+C + Ctrl+Shift+V

      python manage.py createsuperuser

  • Run tests

    • Get access to the container

      docker exec -it <container_name> sh
    • Press Ctrl+C + Ctrl+Shift+V

      python manage.py test

❌ Stop

docker compose stop