williamvongphan / p00_buttery-belligerent-blogger

Blog in Flask (cool)
MIT License
0 stars 0 forks source link

very interesting __init__.py #2

Open huiwxng opened 1 year ago

huiwxng commented 1 year ago

I found this index function very interesting:

@app.route('/')
def index():
    latlong_pair_1 = util.random_latlong()
    latlong_pair_2 = util.random_latlong()
    haversine = util.haversine(
        latlong_pair_1[1],
        latlong_pair_1[0],
        latlong_pair_2[1],
        latlong_pair_2[0]
    )
    return render_index.build_page(latlong_pair_1, latlong_pair_2, haversine)

what does util do?

williamvongphan commented 1 year ago

Seems like we forgot to remove the placeholder I left there 😂

Util holds random functions that we'll be using throughout our project (except it didn't really get used)