Re: Error : socket.gaierror: [Errno -5] No address associated with hostname

2015-04-17 Thread SHINTO PETER
Thank you François. i got it. i will give gethostbyaddr() or gethostbyname()

On Fri, Apr 17, 2015 at 6:15 PM, François Schiettecatte <
fschietteca...@gmail.com> wrote:

> I know what socket.gethostname() does, we still dont know what it returns
> on your setup. And the exception you get is about the host name. Note that
> a host can have multiple host names and socket.gethostname() only returns
> one, which may not be the one you want to use. By default a machine will
> have the host name 'localhost' which is a loopback, but it may have others
> if it is part of a network.
>
> F.
>
> > On Apr 17, 2015, at 8:05 AM, SHINTO PETER  wrote:
> >
> > socket.gethostname()
> > Return a string containing the hostname of the machine where the Python
> interpreter is currently executing ie in python documentation
> >
> > so ie used gethostname()
> >
> >
> > On Friday, 17 April 2015 17:31:11 UTC+5:30, François Schiettecatte wrote:
> > Well then why do you get it from socket.gethostname() ? Just set it to
> 'localhost'.
> >
> > F.
> >
> > > On Apr 17, 2015, at 7:56 AM, SHINTO PETER  wrote:
> > >
> > > i just want to give host as localhost / 127.0.0.1
> > >
> > > On Friday, 17 April 2015 17:15:05 UTC+5:30, François Schiettecatte
> wrote:
> > > What is the value of host?
> > >
> > > François
> > >
> > > > On Apr 17, 2015, at 7:38 AM, SHINTO PETER 
> wrote:
> > > >
> > > > socket.gaierror: [Errno -5] No address associated with hostname
> > > >
> > > > # server.py
> > > > import socket
> > > > import time
> > > > # create a socket object
> > > > serversocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM)
> > > > # get local machine name
> > > > host = socket.gethostname()
> > > > port = 
> > > > # bind to the port
> > > > serversocket.bind((host, port))
> > > > # queue up to 5 requests
> > > > serversocket.listen(5)
> > > > while True:
> > > > # establish a connection
> > > > clientsocket,addr = serversocket.accept()
> > > > print("Got a connection from %s" % str(addr))
> > > > currentTime = time.ctime(time.time()) + "\r\n"
> > > > clientsocket.send(currentTime.encode('ascii'))
> > > > clientsocket.close()
> > > >
> > > > --
> > > > 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...@googlegroups.com.
> > > > To post to this group, send email to django...@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/81750d83-aae9-4382-bdee-8860671b6682%40googlegroups.com
> .
> > > > For more options, visit https://groups.google.com/d/optout.
> > >
> > >
> > > --
> > > 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...@googlegroups.com.
> > > To post to this group, send email to django...@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/fb79843b-5888-42c1-b8eb-ec59aca7f9f9%40googlegroups.com
> .
> > > For more options, visit https://groups.google.com/d/optout.
> >
> >
> > --
> > 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/c7579f3d-4eb3-44ee-9d1a-1ec608a7123a%40googlegroups.com
> .
> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Django users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/django-users/X7KRVS0wk8g/unsubscribe.
> To unsubscribe from this group and all its topics, 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/06E04B96-1335-43BB-AAC0-0EA2BEBD51B6%40gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
SHINTO PETER
NIRAPPIL
09591040010

-- 
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 

Re: Error : socket.gaierror: [Errno -5] No address associated with hostname

2015-04-17 Thread François Schiettecatte
I know what socket.gethostname() does, we still dont know what it returns on 
your setup. And the exception you get is about the host name. Note that a host 
can have multiple host names and socket.gethostname() only returns one, which 
may not be the one you want to use. By default a machine will have the host 
name ‘localhost’ which is a loopback, but it may have others if it is part of a 
network.

F.

> On Apr 17, 2015, at 8:05 AM, SHINTO PETER  wrote:
> 
> socket.gethostname()
> Return a string containing the hostname of the machine where the Python 
> interpreter is currently executing ie in python documentation
> 
> so ie used gethostname()
> 
> 
> On Friday, 17 April 2015 17:31:11 UTC+5:30, François Schiettecatte wrote:
> Well then why do you get it from socket.gethostname() ? Just set it to 
> ‘localhost’. 
> 
> F. 
> 
> > On Apr 17, 2015, at 7:56 AM, SHINTO PETER  wrote: 
> > 
> > i just want to give host as localhost / 127.0.0.1 
> > 
> > On Friday, 17 April 2015 17:15:05 UTC+5:30, François Schiettecatte wrote: 
> > What is the value of host? 
> > 
> > François 
> > 
> > > On Apr 17, 2015, at 7:38 AM, SHINTO PETER  wrote: 
> > > 
> > > socket.gaierror: [Errno -5] No address associated with hostname 
> > > 
> > > # server.py 
> > > import socket 
> > > import time 
> > > # create a socket object 
> > > serversocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM) 
> > > # get local machine name 
> > > host = socket.gethostname() 
> > > port =  
> > > # bind to the port 
> > > serversocket.bind((host, port)) 
> > > # queue up to 5 requests 
> > > serversocket.listen(5) 
> > > while True: 
> > > # establish a connection 
> > > clientsocket,addr = serversocket.accept() 
> > > print("Got a connection from %s" % str(addr)) 
> > > currentTime = time.ctime(time.time()) + "\r\n" 
> > > clientsocket.send(currentTime.encode('ascii')) 
> > > clientsocket.close() 
> > > 
> > > -- 
> > > 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...@googlegroups.com. 
> > > To post to this group, send email to django...@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/81750d83-aae9-4382-bdee-8860671b6682%40googlegroups.com.
> > >  
> > > For more options, visit https://groups.google.com/d/optout. 
> > 
> > 
> > -- 
> > 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...@googlegroups.com. 
> > To post to this group, send email to django...@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/fb79843b-5888-42c1-b8eb-ec59aca7f9f9%40googlegroups.com.
> >  
> > For more options, visit https://groups.google.com/d/optout. 
> 
> 
> -- 
> 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/c7579f3d-4eb3-44ee-9d1a-1ec608a7123a%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/06E04B96-1335-43BB-AAC0-0EA2BEBD51B6%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error : socket.gaierror: [Errno -5] No address associated with hostname

2015-04-17 Thread SHINTO PETER
 socket.gethostname()

Return a string containing the hostname of the machine where the Python 
interpreter is currently executing ie in python documentation
so ie used gethostname()

On Friday, 17 April 2015 17:31:11 UTC+5:30, François Schiettecatte wrote:
>
> Well then why do you get it from socket.gethostname() ? Just set it to 
> ‘localhost’. 
>
> F. 
>
> > On Apr 17, 2015, at 7:56 AM, SHINTO PETER  > wrote: 
> > 
> > i just want to give host as localhost / 127.0.0.1 
> > 
> > On Friday, 17 April 2015 17:15:05 UTC+5:30, François Schiettecatte 
> wrote: 
> > What is the value of host? 
> > 
> > François 
> > 
> > > On Apr 17, 2015, at 7:38 AM, SHINTO PETER  wrote: 
> > > 
> > > socket.gaierror: [Errno -5] No address associated with hostname 
> > > 
> > > # server.py 
> > > import socket 
> > > import time 
> > > # create a socket object 
> > > serversocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM) 
> > > # get local machine name 
> > > host = socket.gethostname() 
> > > port =  
> > > # bind to the port 
> > > serversocket.bind((host, port)) 
> > > # queue up to 5 requests 
> > > serversocket.listen(5) 
> > > while True: 
> > > # establish a connection 
> > > clientsocket,addr = serversocket.accept() 
> > > print("Got a connection from %s" % str(addr)) 
> > > currentTime = time.ctime(time.time()) + "\r\n" 
> > > clientsocket.send(currentTime.encode('ascii')) 
> > > clientsocket.close() 
> > > 
> > > -- 
> > > 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...@googlegroups.com. 
> > > To post to this group, send email to django...@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/81750d83-aae9-4382-bdee-8860671b6682%40googlegroups.com.
>  
>
> > > For more options, visit https://groups.google.com/d/optout. 
> > 
> > 
> > -- 
> > 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...@googlegroups.com . 
> > To post to this group, send email to django...@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/fb79843b-5888-42c1-b8eb-ec59aca7f9f9%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>

-- 
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/c7579f3d-4eb3-44ee-9d1a-1ec608a7123a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error : socket.gaierror: [Errno -5] No address associated with hostname

2015-04-17 Thread François Schiettecatte
Well then why do you get it from socket.gethostname() ? Just set it to 
‘localhost’.

F.

> On Apr 17, 2015, at 7:56 AM, SHINTO PETER  wrote:
> 
> i just want to give host as localhost / 127.0.0.1
> 
> On Friday, 17 April 2015 17:15:05 UTC+5:30, François Schiettecatte wrote:
> What is the value of host? 
> 
> François 
> 
> > On Apr 17, 2015, at 7:38 AM, SHINTO PETER  wrote: 
> > 
> > socket.gaierror: [Errno -5] No address associated with hostname 
> > 
> > # server.py 
> > import socket 
> > import time 
> > # create a socket object 
> > serversocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM) 
> > # get local machine name 
> > host = socket.gethostname() 
> > port =  
> > # bind to the port 
> > serversocket.bind((host, port)) 
> > # queue up to 5 requests 
> > serversocket.listen(5) 
> > while True: 
> > # establish a connection 
> > clientsocket,addr = serversocket.accept() 
> > print("Got a connection from %s" % str(addr)) 
> > currentTime = time.ctime(time.time()) + "\r\n" 
> > clientsocket.send(currentTime.encode('ascii')) 
> > clientsocket.close() 
> > 
> > -- 
> > 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...@googlegroups.com. 
> > To post to this group, send email to django...@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/81750d83-aae9-4382-bdee-8860671b6682%40googlegroups.com.
> >  
> > For more options, visit https://groups.google.com/d/optout. 
> 
> 
> -- 
> 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/fb79843b-5888-42c1-b8eb-ec59aca7f9f9%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/FE8AD0A8-DA52-4720-B4EE-8DA2E1A188CE%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error : socket.gaierror: [Errno -5] No address associated with hostname

2015-04-17 Thread SHINTO PETER
i just want to give host as localhost / 127.0.0.1

On Friday, 17 April 2015 17:15:05 UTC+5:30, François Schiettecatte wrote:
>
> What is the value of host? 
>
> François 
>
> > On Apr 17, 2015, at 7:38 AM, SHINTO PETER  > wrote: 
> > 
> > socket.gaierror: [Errno -5] No address associated with hostname 
> > 
> > # server.py 
> > import socket 
> > import time 
> > # create a socket object 
> > serversocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM) 
> > # get local machine name 
> > host = socket.gethostname() 
> > port =  
> > # bind to the port 
> > serversocket.bind((host, port)) 
> > # queue up to 5 requests 
> > serversocket.listen(5) 
> > while True: 
> > # establish a connection 
> > clientsocket,addr = serversocket.accept() 
> > print("Got a connection from %s" % str(addr)) 
> > currentTime = time.ctime(time.time()) + "\r\n" 
> > clientsocket.send(currentTime.encode('ascii')) 
> > clientsocket.close() 
> > 
> > -- 
> > 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...@googlegroups.com . 
> > To post to this group, send email to django...@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/81750d83-aae9-4382-bdee-8860671b6682%40googlegroups.com.
>  
>
> > For more options, visit https://groups.google.com/d/optout. 
>
>

-- 
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/fb79843b-5888-42c1-b8eb-ec59aca7f9f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Error : socket.gaierror: [Errno -5] No address associated with hostname

2015-04-17 Thread François Schiettecatte
What is the value of host?

François

> On Apr 17, 2015, at 7:38 AM, SHINTO PETER  wrote:
> 
> socket.gaierror: [Errno -5] No address associated with hostname
> 
> # server.py 
> import socket 
> import time 
> # create a socket object 
> serversocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM) 
> # get local machine name 
> host = socket.gethostname() 
> port =  
> # bind to the port 
> serversocket.bind((host, port)) 
> # queue up to 5 requests 
> serversocket.listen(5) 
> while True: 
> # establish a connection 
> clientsocket,addr = serversocket.accept() 
> print("Got a connection from %s" % str(addr))
> currentTime = time.ctime(time.time()) + "\r\n"
> clientsocket.send(currentTime.encode('ascii'))
> clientsocket.close()
> 
> -- 
> 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/81750d83-aae9-4382-bdee-8860671b6682%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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/0EECBFFC-5CFC-4194-B6CE-C54CC5DFBAE4%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


Error : socket.gaierror: [Errno -5] No address associated with hostname

2015-04-17 Thread SHINTO PETER
socket.gaierror: [Errno -5] No address associated with hostname

# server.py 
import socket 
import time 
# create a socket object 
serversocket = socket.socket( socket.AF_INET, socket.SOCK_STREAM) 
# get local machine name 
host = socket.gethostname() 
port =  
# bind to the port 
serversocket.bind((host, port)) 
# queue up to 5 requests 
serversocket.listen(5) 
while True: 
# establish a connection 
clientsocket,addr = serversocket.accept() 
print("Got a connection from %s" % str(addr))
currentTime = time.ctime(time.time()) + "\r\n"
clientsocket.send(currentTime.encode('ascii'))
clientsocket.close()

-- 
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/81750d83-aae9-4382-bdee-8860671b6682%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.