D
D
Dima_kras2019-07-15 09:11:29
Python
Dima_kras, 2019-07-15 09:11:29

Open access to the flask server from outside?

Hello, I can't figure it out. I start the flask server:
app.run(host="localhost", port="80") If you type localhost
in the browser , everything is OK, the site opens. But if you type 192.168.1.10 (this is the ip of the computer on which the server is running) - it does not open. If you write app.run(host="192.168.1.10", port="80") The server is accessible by ip, but ip can change. How to start server from "localhost" but have access by ip?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2019-07-15
@Dima_kras

app.run(host="0.0.0.0", port="80")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question