Skip to content

Anatolii-Poznyak/new_test_task

Repository files navigation

🎩 Just a simple test task

Simple django proj. dockerized

🖥️ Technologies

Python PostgreSQL Docker Django

📝 Requirements

  • Python 3.7+
  • Django 4.2.1+
  • PostgreSQL

🛠 Before installation

  1. Clone the project repository
git clone https://github.com/Anatolii-Poznyak/new_test_task.git
cd new_test_task
  1. Create a virtual environment
python3 -m venv venv
source venv/bin/activate
  1. Create .env file based on .env.sample file and set variables.
cp .env.sample .env
  • If you want to use Docker, set POSTGRES_HOST=db
  • Also set your superuser credentials in .env

🐳 Run with DOCKER

  • DOCKER should be installed
  docker-compose up
  • The server will run on 127.0.0.1:8000
  • superuser and fake_data will be created and loaded automatically via custom migrations

📚 Additional info

  • To enter the container => docker compose exec app sh or docker exec -it <your container name> /bin/bash
  • Containers list => docker ps
  • Fake data is generated by fake_data.py command

🅰️ AWS bootstrap script

  • Click
    
          #!/bin/bash
          yum update -y
          yum install -y docker
          service docker start
          usermod -a -G docker ec2-user
          
          curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
          
          chmod +x /usr/local/bin/docker-compose
          docker-compose version
          yum install -y git
          git clone https://github.com/Anatolii-Poznyak/new_test_task.git /home/ec2-user/new_test_task
          cd /home/ec2-user/new_test_task
          
          echo "DJANGO_SECRET_KEY=test" >> .env
          echo "DJANGO_DEBUG=True" >> .env
          echo "POSTGRES_HOST=db" >> .env
    
          # And all others environment variables...
          
          docker-compose up -d
      
  • Video running sample (youtube)

Releases

No releases published

Packages

No packages published