0

I'm still new to Pi And Python - so forgive what might be a silly question. I need to set up a very simple HTTP Server - that can be accessed from the internet. I don't need the complexity of Apache or anything like that.

After much reading - so far I can use python -m http.server --cgiwhich will let me run a python program from the web. Great.

The problem is this is slow as the program has to load, do what it does, and then send it. I have found other examples that wrap http.server within the python program - but they all say localhost only.

What do I need to do to manage a simple 'GET' request from within python - that can can be accessed from the Pis IP address?

Thanks - fortunately I have plenty of hair to pull out at the moment. :-)

AndyL
  • 1
  • 1
    https://docs.python.org/3/library/wsgiref.html#examples – Peter Wood May 29 '20 at 15:22
  • Even if you only want a very simple HTTP server, my suggestion would be to [set up nginx](https://www.raspberrypi.org/documentation/remote-access/web-server/nginx.md) and [configure it to run Python for you](https://stackoverflow.com/questions/7048057/running-python-through-fastcgi-for-nginx). – Tomalak May 29 '20 at 15:42

0 Answers0