Ejemplo n.º 1
0
def index():
    ''' Index page '''
    print request.remote_addr
    underground = Underground(UNDERGROUND_KEY)

    try:
        conditions = underground.get_feature_by_ip('conditions',
                                                   request.access_route[0]) 
    except QueryNotFoundError:
        if app.debug:
            conditions = underground.get_feature_by_ip('conditions',
                                                       '98.118.119.64') 
        

    return render_template('current-weather.html', conditions=conditions)
Ejemplo n.º 2
0
def hourly():
    ''' Hourly weather data '''
    if request.is_xhr:
        full = False
    else:
        full = True

    underground = Underground(UNDERGROUND_KEY)

    try:
        hourly = underground.get_feature_by_ip('hourly',
                                               request.access_route[0]) 
    except QueryNotFoundError:
        if app.debug:
            hourly = underground.get_feature_by_ip('hourly',
                                                   '98.118.119.64') 

    return render_template('hourly-weather.html', full=full, hourly=hourly )