Domanda

I'm using GNU/Linux Ubuntu 13.04 Raring Ringtail x32 bits. I have a wireless network connection in my house and I want that others computers connected see my localhost.

I created a web page using Python Django 1.4 and it listen in http://localhost:8000/. I read about it, but, I don't undertood about how to setting up my local ip.

When I write this in the terminal ifconfig, it shows this:

eth0 Link encap:Ethernet HWaddr 18:a9:05:dd:32:fc
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)            

eth1 Link encap:Ethernet HWaddr 90:4c:e5:3b:fe:c3
    inet addr:192.168.1.18 Bcast:192.168.1.255 Mask:255.255.255.0
    inet6 addr: fe80::924c:e5ff:fe3b:fec3/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:9880 errors:0 dropped:0 overruns:0 frame:7882
    TX packets:9386 errors:12 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:9839915 (9.8 MB) TX bytes:1643176 (1.6 MB)
    Interrupt:16 Base address:0xc000            

lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:65536 Metric:1
    RX packets:1535 errors:0 dropped:0 overruns:0 frame:0
    TX packets:1535 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:0
    RX bytes:222541 (222.5 KB) TX bytes:222541 (222.5 KB)

How to setting up it to see my local website in others computers using my wireless connection.

Thanks so much for your help!

È stato utile?

Soluzione

You can bind your Django server to your machine's IP address and then hit that on your other machines on the same LAN:

$ python manage.py runserver 192.168.1.18:8000

Altri suggerimenti

Just add this to your normal runserver command:

python manage.py runserver 0.0.0.0:8000

Then others on your local network can access it through:

http://192.168.1.18:8000
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top