- Python 3
- Django 2
Clone the repository and then change directory to the cloned repository.
- Setup and active your virtual environment
python3 -m venv venv
source venv/bin/activate
- Install Python dependencies
pip install -r requirements-dev.txt
- Run the database migrations and load data into the database
python manage.py migrate
python manage.py loaddata metrics
- Run the API
python manage.py runserver
- Show the number of impressions and clicks that occurred before the 1st of June 2017, broken down by channel and country, sorted by clicks in descending order.
- Show the number of installs that occurred in May of 2017 on iOS, broken down by date, sorted by date in ascending order.
- Show revenue, earned on June 1, 2017 in US, broken down by operating system and sorted by revenue in descending order.
- Show CPI and spend for Canada (CA) broken down by channel ordered by CPI in descending order. Please think carefully which is an appropriate aggregate function for CPI.
- http://localhost:8000/api/metrics/?fields=cpi,spend,channel&groupby=channel&country=CA&ordering=-cpi
Run the tests
python manage.py test
- Dockerize the application.