0

I'm writing a small web app with microframework Flask. I'm trying to run the app on my personal domain and not on the preset localhost because i want that people use this webapp outside my network.

I try to change preset setting but webapp works in other pc only under my network (same wifi).

This is my code.py

app = Flask(__name__)
if __name__ == "__main__":
    app.secret_key = ".."
    #app.run(port=4555, debug=True)  #on local host
    #app.run(host = '0.0.0.0', port = 3134, debug= False)  #it works under my network
    #???  #what i have to write to run app on 'example.tk'?
Teor9300
  • 545
  • 2
  • 6
  • 9

1 Answers1

0

You will first need to open the port 3134 on your router, so it is handled by your computer. Then, if your domain is already linked to your public IP, you will be able to access the service from the internet

Anthony Rossi
  • 1,182
  • 8
  • 14
  • without change the settings of router, is there a way to do run on example.tk? And also: what do you mean with "your domain is already linked to your public IP"? How i can do this? – Teor9300 Jun 15 '17 at 10:12
  • You will absolutely need to modify your router's settings. A domain is not a server, it's just a human-readable name for an IP address. As such, if it is not linked to your IP address, it just point to nothing. To link it, follow the procedure on the website where you acquired the domain name. – Anthony Rossi Jun 15 '17 at 13:59
  • ok i had modify router settings, i had link my ip adress but now what i have to write in my code.py ( for example the domine is 'example.tk')? – Teor9300 Jun 15 '17 at 20:02
  • I opened port 3134 on my router (associated with my ip 192.168.x.x), then i linked my domain 'example.tk' with my pubblic ip. Now i run app in this way: app.run(host = '0.0.0.0',port = 3134, debug=False) But when i open 'example.tk' the page is empty and white. (While i write in url bar my ip '192.168.x.x' it works and i can see all my pages) – Teor9300 Jun 15 '17 at 21:37