Assessment Task For Django Developer
Assessment Task For Django Developer
Weather Forecast App Tech Stack Required: Django 2 and Rest API
Task Description:
We need to create an application to display the weather forecast for a selected set of
coordinates with selected type of detailing data. User will require to enter lat and lon in
the inputs and chose detailing type according to API
● Current weather Minute forecast for 1 hour
● Hourly forecast for 48 hours
● Daily forecast for 7 days
Plus points for: Allow the user to input the location via a Google map plugin.
By default local DB is empty and we should fill it with data from users’ requests. We need
to create API endpoint which will receive
● Lat
● Lon
● detailing type
We will first try to find weather forecast in the local DB, if the required data is not present
then we will request it from openweathermap and save to our local DB. Also, the data
that we store in the local DB should be time sensitive, and it should be configurable from
Django settings (by default 10 minutes). This means if the required data was received
more than 10 minutes ago, we need to request the data again, and in case the new data
received is different from the one stored, we will update it in the local DB.
For example:
1. User requests information for “lat: 33.441792 lon: -94.037689 and detailing
type=Minute forecast” at 10:00 AM, as we don’t have this data in local DB, we will
request data from openweathermap and save to the local DB.
2. After 5 minutes, the user again makes the same request (at 10:05). Here we will
return data from the local DB, because the data is still relevant.
3. Then the user again makes the request after 20 minutes (at 10:25). Here we
should request data from openweathermap again because the data in the local
DB is no longer relevant.