waitress insists on using port 5000

469 views Asked by At

example code is here

In particular

if __name__ == "__main__":
    # app.run() ##Replaced with below code to run it using waitress
    serve(app, host='0.0.0.0', port=8000)

produces the result

and I can access it on http://127.0.0.1:5000/ only. I can change the port number to anything but waitress insists on using port 5000.

This must be something simple and obvious. What am I doing wrong? I am running windows 10.

PS. Waitress version 1.4.4

PPS. Flask does the same thing if I do app.run(host = '0.0.0.0', port = 80) it still runs on 5000.

1

There are 1 answers

0
Andrew Walsh On

Mybad! I was running it from Pycharm IDE by right clicking the script tab and selecting Run (ctrl-shift-F10). When I run it from the command line eg. python test.py it works fine.