Пример #1
0
def index(_):
    """ Main route which returns all versions. """
    weather = Weather()
    return HttpResponse(weather.to_json())
Пример #2
0
def city(_, area, region):
    """ Get weather by area. i.e. Austin,tx"""
    weather = Weather(area + ',' + region)
    return HttpResponse(weather.to_json())
Пример #3
0
 def test_weather_json(self):
     weather = Weather()
     json = weather.to_json()
     self.assertIsNotNone(json)