-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
35 lines (26 loc) · 813 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
app.py
Main app for site
"""
import weather, location
from flask import Flask, render_template, request, redirect, url_for, session
app = Flask(__name__)
@app.route('/')
def index():
location_data = location.get_location()
city = location_data["city"]
country = location_data["country"]
max_temp = round(weather.get_maximum_temperature(),2)
min_temp = round(weather.get_minimum_temperature(),2)
# # dummy input
# city = "City"
# country = "Country"
# max_temp = 2.31
# min_temp = -10.31
return render_template('index.html', city=city, country=country, max_temp=max_temp, min_temp=min_temp)
@app.route('/about')
def about():
author = "Sachh Moka"
return render_template('about.html',author=author)
if __name__ == '__main__':
app.run()