I am trying to create a Flask app (using Python 2.7) that I can access from across networks, as the title says. I have managed to get the app up and running, and it works successfully all across the Wi-Fi network of my computer where the app is running. I have been accessing it using my internal IP address and port 8000. Whenever I connect from my phone, which is connected to the Wi-Fi, it works. However, when I switch to cellular data and connect from that, it doesn't work, and instead says "took too long to respond". The code for the app itself is as follows:
from flask import Flask, render_template
from GradeScraper import scrapeforgrades
app = Flask(__name__)
@app.route('/')
def home():
scrapeforgrades()
return render_template("Grades.html")
if __name__ == '__main__':
app.run(host='0.0.0.0', port=8000, debug=True)
GradeScraper is just a web scraper I have written, to be called in the app. I don't believe that file is the reason for my problems.
I have also tried connecting to the app from my external IP address, but it says "refused to connect". I went to this StackOverflow page I found, and the answer said something about security settings. I didn't understand at all how to change those. The person who asked the question commented at the end "I played around with security settings and finally got it working" which leads me to the conclusion that I should do the same. Unfortunately, I have no idea how to do that. Could anybody point me in the right direction? I'll provide any and all extra information needed.
Thanks,
Me