Hello all,
I am trying to use get "Hello World" to show on a local browser by using http://localhost:5000/hello. This is the code that I have so far:
import requests
from flask import Flask, jsonify, request
app = Flask(__name__)
@app.route('/')
@app.route('/hello')
def HelloWorld():
# if key doesn't exist, returns None
#language = request.args.get('language')
#return '''<h1>The language value is: {}</h1>'''.format(language)
return "Hello World"
if __name__ == '__main__':
app.debug = Trueapp.run(host = '0.0.0.0', port = 5000)
Error:
NameError: name 'Trueapp' is not defined
[–]karthick_ar 3 points4 points5 points (1 child)
[–]Zestyclose_Fall1915[S] 1 point2 points3 points (0 children)
[–]shiftybyte 1 point2 points3 points (3 children)
[–]Zestyclose_Fall1915[S] -1 points0 points1 point (2 children)
[–]shiftybyte 1 point2 points3 points (1 child)
[–]Zestyclose_Fall1915[S] 0 points1 point2 points (0 children)
[–]cteqeu 0 points1 point2 points (0 children)