API for daily weather tracking. This project is designed to fetch daily weather information for Kyiv for today and the next 5 days
- Python 3.7+
- Django 4.2.1+
- PostgreSQL
- Docker
- Clone the project repository
git clone https://github.com/Anatolii-Poznyak/weather-api-test-task.git
cd weather-api-test-task
- Create a virtual environment
python3 -m venv venv
source venv/bin/activate
- 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
- 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
- To enter the container ->
docker compose exec web sh
ordocker 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 (bypython 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
/api/doc/swagger/