I\'m not sure if this is Flask specific, but when I run an app in dev mode (http://localhost:5000
), I cannot access it from other machines on the network (with
If you're having troubles accessing your Flask server, deployed using PyCharm, take the following into account:
PyCharm doesn't run your main .py file directly, so any code in if __name__ == '__main__':
won't be executed, and any changes (like app.run(host='0.0.0.0', port=5000)
) won't take effect.
Instead, you should configure the Flask server using Run Configurations, in particular, placing --host 0.0.0.0 --port 5000
into Additional options field.
More about configuring Flask server in PyCharm