Ejemplo n.º 1
0
def result():
    if request.method == 'POST':
        lat = request.form['Latitude']
        lon = request.form['Longitude']
        url = 'http://api.openweathermap.org/data/2.5/weather?lat=' + str(lat) + '&lon=' + str(lon) + '&appid=ce0c5d404829241dc9b2ddbd3cc25a73'
        # TODO: fix this asap, can`t be like that, object will be created with every request
        gate = Gateway()
        data = gate.get_data(url)
        return render_template('layout.html',data = data)
Ejemplo n.º 2
0
def home():
    url = 'http://api.openweathermap.org/data/2.5/weather?q=London,uk&appid=ce0c5d404829241dc9b2ddbd3cc25a73'
    # TODO: fix this asap, can`t be like that, object will be created with every request
    gate = Gateway()
    data = gate.get_data(url)
    return render_template('layout.html',data = data)
Ejemplo n.º 3
0
def home():
    url = 'http://api.openweathermap.org/data/2.5/weather?q=London,uk&appid=2de143494c0b295cca9337e1e96b00e0'
    # TODO: fix this asap, can`t be like that, object will be created with every request
    gate = Gateway()
    return render_template('layout.html', data=gate.get_data(url))