On 2013-12-09 10:44, Muhammad Ali wrote:
> Instructions I found online (such as this one: ) say that I should
> plug the phone to the computer through a USB and run: manage.py
> runser 0.0.0.0:8000 and visit this IP address via my phone's
> browser. But it doesn't work and instead returns an error:
> 
> "Oops! Google Chrome could not connect to 0.0.0.0:8000" 
The "runserver 0.0.0.0:8000" tells Django to listen on all interfaces
you have.  You'd have to determine the IP address of your server
(well, dev machine).  Usually you can get this from the output of
"ifconfig -a" (or "ipconfig /all" on Win32).  It will usually return
something like 192.168.x.y 

Depending on how you're tethered, you want to point your phone to
that address:

  http://192.168.3.14:8000/

Some tethering forces the phone to appear outside your network,
preventing it from seeing the private/internal 192.168.x.y
addresses.  This complicates matters, as you'd have to adjust your
router/NAT to open port 8000 (or port 80 for that matter) and point
it at your box internally.  You'd then have to visit your site via
your external IP address.  So you it might look something like

  phone
   |
   v
  internet
   |
   v
  router 123.45.67.89
   |
   | configure router NAT to listen on 80
   |   and forward internally
   |   to 192.168.x.y on port 8000
   v
  computer 192.168.x.y listening on port 8000

You can find your external IP address by just googling for it:

  https://www.google.com/search?q=my+IP+address

which includes the answer before the other actual search results.
Once you have that external address, you can use

  http://123.45.67.89/

to access it (note that if you forward 8000-to-8000 instead of
80-to-8000, you'd have to specify the port as :8000 in the URL)

-tkc



-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/20131209130815.323c8fd8%40bigbox.christie.dr.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to