M
M
Mikhail Lebedev2020-05-11 11:18:25
Python
Mikhail Lebedev, 2020-05-11 11:18:25

Publicly accessible Python server?

how to make it so that people can get into the application from another device?

found it


Publicly Accessible Server

If you start the server, you will notice that it is only accessible from your own computer and not from anyone else on the network. This is done by default because in debug mode, the application user can execute Python code on your computer.
If you have the debug option turned off or you trust users on the network, you can make the server publicly available by simply changing the call to the run() method like this:

app.run(host='0.0.0.0')
This will tell your operating system to she listened to the network from all public IP addresses.


but when adding app.run(host='0.0.0.0') to the code, the application is available at 0.0.0.0:5000 only on the device from which it was launched,

I would like to test it on others)))

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question