Showing posts with label Linux Python http simple. Show all posts
Showing posts with label Linux Python http simple. Show all posts

Jan 12, 2012

Simple WebServer Usando Python

Supongamos que queremos setear un HTTP server de forma simple y rapida, en tu maquina en un directorio en particular.  Digamo queremos que testHTML5App entonces hacemos:
Nos vamos al directorio
  $cd /home/somedir/testHTML5app
Ejecutamos python con el modulo SimpleHTTPServer
  $python -m SimpleHTTPServer
Y ya esta tenemos nuestro http server corriendo en el puerto 8000
      Serving HTTP on 0.0.0.0 port 8000
Ahora podes acceder con http://tu-ip:puertp/ en cualquier browser
  http://192.168.1.2:8000
o  si quere en tu maquina usando el loopback ip
  http://127.0.0.1:8000

Si queres cheques mas info podes ir a docs.python.org (simpleHTTPServer)