Advertisement
Tenyson

APi

Feb 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. from flask import Flask, render_template, request
  2. import requests
  3.  
  4. app = Flask(__name__)
  5.  
  6. @app.route('/index.html', methods=['GET'])
  7. def temperature():
  8. temp = requests.get('http://api.openweathermap.org/data/2.5/weather?q=Papine&APPID=edf527089b81fad23c7c1367deb728ec')
  9. textForm = temp.json()
  10. return render_template('index.html', hhhh=textForm)
  11.  
  12. if __name__ == '__main__':
  13. app.run(debug=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement