If you look closely at the traceback you will see
app.run(host='0.0.0.0', port=5000)
which means that no matter what port is passed in by -p
, port 5000 is hardcoded.
You will need to modify it to use whatever variable the script is storing the -p
argument as.