I am relatively new to python and have setup a local virtualenviorenment on my mac desktop. I am utilizing the Flask, jsonify, and requests frameworks.
Inside of myvirtualenviorenment I have two files: one that just uses flask and one which uses flask, jsonify, and requests frameworks. I believe I have imported all these frameworks correctly, but when I run the second file, which is a GET request, using all 3 frameworks, I dont get a response at all from terminal.
However, I am able to access 127.0.0.1:5000 when just using the Flask framework. Did I not properly import the jsonify and request frameworks?
Below is my code for the non-working file:
from flask import Flask, jsonify, request #import objects from the Flask model
app = Flask(__name__) #define app using Flask
@app.route('/', methods=['GET'])
def test():
return jsonify({'message' : 'It works!'})
if __name__== '__main__':
app.run(debug=True, port=8080) #run app on port 8080 in debug mode