Trouble Starting Up with runserver

89 views
Skip to first unread message

Chris DPS

unread,
May 7, 2009, 3:48:08 AM5/7/09
to Django users
I am new to Django.

When I try to execute: python manage.py runserver, I get the following
error

Error: [Errno 10104] getaddrinfo failed

What is going on and what should I do?
I have tried with 0.0.0.0:8000.

I am running Django Version 1.0.2-final and Python 2.6

John Crawford

unread,
May 7, 2009, 10:17:08 AM5/7/09
to Django users
I'm not sure why your address is all zeros, did you give a specific
host number parameter to runserver?

Generally 127.0.0.0:8000 would be your localhost, and that is the
default for runserver. Use that instead (or don't give it any
parameters), see what happens.

John C>

John Crawford

unread,
May 7, 2009, 10:18:23 AM5/7/09
to Django users
Arg - I meant 127.0.0.1:8000

Is there a way to edit messages that I dont see here? :)

John C>

Phil Mocek

unread,
May 7, 2009, 11:43:55 AM5/7/09
to django...@googlegroups.com
On Thu, May 07, 2009 at 07:17:08AM -0700, John Crawford wrote:
> I'm not sure why your address is all zeros, did you give a
> specific host number parameter to runserver?

That causes the development server to listen on all available
network interfaces. This, unfortunately, is not explained in the
runserver documentation [1] or the admin utility's built-in help.
The only place I've found it documented is in chapter two of The
Django Book [2]. This is not Django-specific, as RFC 3330
("Special-Use IPv4 Addresses") [3] defines addresses in the
0.0.0.0/8 block as referring to "source hosts on `this' network",
but it seems that it would be helpful to note this in the Django
docs for people who are unfamiliar with this convention.

> Generally 127.0.0.0:8000 would be your localhost

That would cause the development server to listen on port 8000 of
whatever interface uses 127.0.0.0. The hostname "localhost" [4]
typically resolves to 127.0.0.1, the address of the loopback
interface [5].


References:

[1]: <http://docs.djangoproject.com/en/1.0/ref/django-admin/#runserver>
[2]: <http://www.djangobook.com/en/2.0/chapter02/#cn112>
[3]: <http://www.rfc-editor.org/rfc/rfc3330.txt>
[4]: <http://en.wikipedia.org/wiki/Localhost>
[5]: <http://en.wikipedia.org/wiki/Loopback>

--
Phil Mocek

donarb

unread,
May 7, 2009, 12:01:01 PM5/7/09
to Django users
On May 7, 8:43 am, Phil Mocek <pmocek-list-django-us...@mocek.org>
wrote:
> This, unfortunately, is not explained in the
> runserver documentation [1] or the admin utility's built-in help.
> The only place I've found it documented is in chapter two of The
> Django Book [2].

It is also documented in the tutorial:

http://docs.djangoproject.com/en/dev/intro/tutorial01/#creating-a-project

Don


Phil Mocek

unread,
May 7, 2009, 1:17:50 PM5/7/09
to django...@googlegroups.com
On Thu, May 07, 2009 at 09:01:01AM -0700, donarb wrote:
> On May 7, 8:43 am, Phil Mocek wrote:
> > This, unfortunately, is not explained in the runserver
> > documentation [1] or the admin utility's built-in help. The
> > only place I've found it documented is in chapter two of The
> > Django Book [2].
>
> It is also documented in the tutorial:
>
> http://docs.djangoproject.com/en/dev/intro/tutorial01/#creating-a-project

Thanks. I plan to open a ticket for an update to the documentation
if one doesn't already exist. I'll add this information.

I missed this mention of 0.0.0.0 because I was searching for
"interface" or "IP address" but the tutorial says -- incorrectly or
colloqially, depending on how you see things -- "So to listen on all
public IPs (useful if you want to show off your work on other
computers), use:". There's no such thing as a "public IP".

--
Phil Mocek

Tim Chase

unread,
May 7, 2009, 1:49:28 PM5/7/09
to django...@googlegroups.com
> was searching for "interface" or "IP address" but the tutorial
> says -- incorrectly or colloqially, depending on how you see
> things -- "So to listen on all public IPs (useful if you want
> to show off your work on other computers), use:". There's no
> such thing as a "public IP".

I suspect the intent is "external IP" compared to an internal IP
(localhost/127.0.0.1). By default Django only listens on
localhost ("private" or "internal"). If your machine is
multi-homed (has multiple IP addresses such as a dialup, aircard,
VPN, LAN, wireless, etc), you can specify that Django listens on
a single address such as 192.168.1.99 (which should be bound to a
single interface). If you specify 0.0.0.0 Django will listen on
any interfaces/IP-address. These latter cases would be "public"
or "external".

-tim

Phil Mocek

unread,
May 7, 2009, 2:23:00 PM5/7/09
to django...@googlegroups.com
On Thu, May 07, 2009 at 12:49:28PM -0500, Tim Chase wrote:
> > was searching for "interface" or "IP address" but the tutorial
> > says -- incorrectly or colloqially, depending on how you see
> > things -- "So to listen on all public IPs (useful if you want
> > to show off your work on other computers), use:". There's no
> > such thing as a "public IP".
>
> I suspect the intent is "external IP" compared to an internal IP
> (localhost/127.0.0.1).

I agree.

What makes the tutorial technically incorrect, and what prevents
someone who seeks information about using the 0.0.0.0 IP address
from finding that passage using reasonable search terms, is its
omission of the word "address". The subject at hand is an
address, not a protocol, yet what was written is "public IP" not
"public IP address". This is fine for casual conversation, but --
for reasons including that which was discovered in this discussion
-- not for a technical tutorial whose target audience is software
developers.

--
Phil Mocek

George Song

unread,
May 7, 2009, 2:39:56 PM5/7/09
to django...@googlegroups.com

This is good clarification. It would be great if one of you can open a
ticket and supply a patch.

--
George

Chris DPS

unread,
May 7, 2009, 6:05:40 PM5/7/09
to Django users


On May 7, 11:23 am, Phil Mocek <pmocek-list-django-us...@mocek.org>
wrote:
Sorry for the confusion.
I have definitely tried it listening only to localhost (i.e. running
python manage.py runserver without additional arguments)

My question is mainly about reasons why the very basic python
manage.py runserver doesn't work
and creates the error 10104 getaddrinfo failed

I only mentioned 0.0.0.0:8000 because this was suggested on a separate
thread as a solution (and it worked for the guy asking). It does not
work for me.

It is something wrong with my computer (and I really don't think I
have any Firewall active - not entirely certain, but pretty sure). I
just did the same setup on a different computer and it is working, but
I need it to work on my own.

Any ideas?
Thanks
Reply all
Reply to author
Forward
0 new messages