Run Flask on my personal domain

时间:2017-06-15 10:02:08

标签: python flask server dns host

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'?

1 个答案:

答案 0 :(得分: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