Skip to content

API for daily weather tracking. This project is designed to fetch daily weather information for Kyiv for today and the next 5 days

Notifications You must be signed in to change notification settings

Anatolii-Poznyak/weather-api-test-task

Repository files navigation

🌇 Weather-api-test-task

API for daily weather tracking. This project is designed to fetch daily weather information for Kyiv for today and the next 5 days

🖥️ Technologies

Python Django Django REST Framework Docker PostgreSQL Redis Celery Django Celery Beat Flower

📝 Requirements

  • Python 3.7+
  • Django 4.2.1+
  • PostgreSQL
  • Docker

🛠 Before installation

  1. Clone the project repository
git clone https://github.com/Anatolii-Poznyak/weather-api-test-task.git
cd weather-api-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
  • server will run on 127.0.0.1:8000
  • superuser will be created and loaded automatically via custom migrations

🖼 Demo pictures

Admin page schedule

Admin page weather

Weather list endpoint

Update endpoint

Update start

Pending status (status endpoint)

Status started

Flower task monitoring

📚 Additional info

  • To enter the container -> docker compose exec web sh or docker exec -it <your container name> /bin/bash
  • Containers list -> docker ps
  • Schedule for day-basis updating information about the weather in Kyiv will be started automatically after docker-compose up command (by python manage.py task_command)
  • You can also change the daily basis time for updating information also by adding an argument after command in terminal (example: python manage.py task_command 17 -> will change time from 9:00 to 17:00). Also you can set this time parameter from the endpoint
  • Flower schedule monitoring will be able on 5555 port (127.0.0.1:5000)
  • Run tests python manage.py test

🕶 Documentation: swagger

/api/doc/swagger/

Swagger

swagger

About

API for daily weather tracking. This project is designed to fetch daily weather information for Kyiv for today and the next 5 days

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published