Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Flask REST API
#2
if __name__ == '__main__':
    app.run(debug=True, host=host, port=port)
where host is the ip of your interface, eg. 192.168.0.2 and port is the port number (default is 5000)

check ifconfig (linux) for the ip address to use (ipconfig for windows)

You should also make sure that the port is not firewalled. If you want to use a port number < 1024 than you need to be root.
Reply


Messages In This Thread
Python Flask REST API - by vndywarhol - Sep-26-2018, 01:24 PM
RE: Python Flask REST API - by thomasp - Sep-28-2018, 12:43 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  REST API using flask - limit connection? korenron 1 1,298 Feb-05-2023, 06:48 PM
Last Post: noisefloor
  Flask Rest API - fire and forget MorganSamage 2 1,623 Feb-04-2023, 11:09 AM
Last Post: MorganSamage
  python 3.7 on windows using flask and flask-sqlalchemy. Alpy 2 4,027 Aug-12-2020, 07:24 PM
Last Post: Alpy
  Simple flask rest api problem cancerboi 4 2,854 Jan-29-2020, 03:10 PM
Last Post: brighteningeyes
  Python Rest API Public/Secret Keys Authentication Nonce dn237 1 2,935 Oct-31-2019, 02:07 AM
Last Post: dn237
  How to Host a REST API that executes a PYTHON script on the WEB SERVER rahul4data 4 3,522 Jan-25-2019, 02:54 PM
Last Post: DeaD_EyE
  Flask rest api How to retrieve json request raysefo 4 6,173 Jan-20-2019, 06:46 PM
Last Post: raysefo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020