|
List Info
Thread: Cannot assign requested address
|
|
| Cannot assign requested address |

|
2007-12-27 18:01:31 |
Hello,
While I was following the chapter 7 (Form processing) of the
django
book, I got the following error:
Traceback (most recent call last):
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/
site-packages/django/core/handlers/base.py" in
get_response
77. response = callback(request, *callback_args,
**callback_kwargs)
File
"/Users/yjlee/Documents/Worx/Django/DjangoWorx/mysite2/
../mysite2/
books/views.py" in contact
30. message, sender, ['administrator example.com'])
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/
site-packages/django/core/mail.py" in send_mail
49. return send_mass_mail([[subject, message, from_email,
recipient_list]], fail_silently, auth_user, auth_password)
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/
site-packages/django/core/mail.py" in send_mass_mail
66. server = smtplib.SMTP(settings.EMAIL_HOST,
settings.EMAIL_PORT)
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/
smtplib.py" in __init__
244. (code, msg) = self.connect(host, port)
File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/
smtplib.py" in connect
310. raise socket.error, msg
error at /contact/
(49, "Can't assign requested address")
It seems that this error was coming from
HttpResponseRedirect() of the
contact view method, but I did not figure what went wrong.
This is my
"contact" view method:
def contact(request):
if request.method == 'POST':
form = ContactForm(request.POST)
if form.is_valid():
topic = form.clean_data['topic']
message = form.clean_data['message']
sender = form.clean_data.get('sender', 'noreply example.com')
send_mail('Feedback from your site, topic: %s' % topic,
message, sender, ['administrator example.com'])
return HttpResponseRedirect('/contact/thanks/')
else:
form = ContactForm()
return render_to_response('books/contact.html', {'form':
form})
One odd thing is that I got the same error (cannot assign
requested
address) even if I tried to redirect HttpResponse to
"http://
www.google.com".
Can anyone explain how to resolve this problem?
Thanks in advance,
YJ
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-users googlegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: Cannot assign requested address |

|
2007-12-27 18:58:33 |
Error is in your SMTP parameters in settings.py or something
similar.
Look at the traceback:
49. return send_mass_mail([[subject, message, from_email,
> recipient_list]], fail_silently, auth_user,
auth_password)
> File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/
> site-packages/django/core/mail.py" in
send_mass_mail
> 66. server = smtplib.SMTP(settings.EMAIL_HOST,
settings.EMAIL_PORT)
> File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/
> smtplib.py" in __init__
On 28 ΔΕΛ, 03:01, "youngjin.mich... gmail.com"
<youngjin.mich... gmail.com> wrote:
> Hello,
>
> While I was following the chapter 7 (Form processing)
of the django
> book, I got the following error:
> Traceback (most recent call last):
> File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/
> site-packages/django/core/handlers/base.py" in
get_response
> 77. response = callback(request, *callback_args,
**callback_kwargs)
> File
"/Users/yjlee/Documents/Worx/Django/DjangoWorx/mysite2/
../mysite2/
> books/views.py" in contact
> 30. message, sender, ['administra... example.com'])
> File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/
> site-packages/django/core/mail.py" in send_mail
> 49. return send_mass_mail([[subject, message,
from_email,
> recipient_list]], fail_silently, auth_user,
auth_password)
> File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/
> site-packages/django/core/mail.py" in
send_mass_mail
> 66. server = smtplib.SMTP(settings.EMAIL_HOST,
settings.EMAIL_PORT)
> File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/
> smtplib.py" in __init__
> 244. (code, msg) = self.connect(host, port)
> File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/
python2.5/
> smtplib.py" in connect
> 310. raise socket.error, msg
>
> error at /contact/
> (49, "Can't assign requested address")
>
> It seems that this error was coming from
HttpResponseRedirect() of the
> contact view method, but I did not figure what went
wrong. This is my
> "contact" view method:
> def contact(request):
> if request.method == 'POST':
> form = ContactForm(request.POST)
> if form.is_valid():
> topic =
form.clean_data['topic']
> message =
form.clean_data['message']
> sender =
form.clean_data.get('sender', 'nore... example.com')
> send_mail('Feedback from your
site, topic: %s' % topic,
> message, sender,
['administra... example.com'])
> return
HttpResponseRedirect('/contact/thanks/')
> else:
> form = ContactForm()
> return render_to_response('books/contact.html',
{'form': form})
>
> One odd thing is that I got the same error (cannot
assign requested
> address) even if I tried to redirect HttpResponse to
"http://www.google.com&qu
ot;.
>
> Can anyone explain how to resolve this problem?
>
> Thanks in advance,
>
> YJ
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-users googlegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: Cannot assign requested address |

|
2007-12-27 19:18:20 |
On Dec 27, 2007 6:01 PM, youngjin.michael gmail.com
<youngjin.michael gmail.com> wrote:
> It seems that this error was coming from
HttpResponseRedirect() of the
> contact view method, but I did not figure what went
wrong.
No, look at the traceback. The lines it's highlighting are
the ones
which send the email, and the error message is saying that
it wasn't
able to establish a connection with your mail server to send
the
email. Double-check the settings you've provided to Django
for email
handling and ensure they correctly specify a mail server
that you have
access to.
--
"Bureaucrat Conrad, you are technically correct -- the
best kind of correct."
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-users googlegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
| Re: Cannot assign requested address |

|
2007-12-28 11:05:24 |
Thanks for the help.
There was a problem with the mail server. Now I got it
working.
Thanks a lot!
On Dec 27, 7:18 pm, "James Bennett"
<ubernost... gmail.com> wrote:
> On Dec 27, 2007 6:01 PM, youngjin.mich... gmail.com
>
> <youngjin.mich... gmail.com> wrote:
> > It seems that this error was coming from
HttpResponseRedirect() of the
> > contact view method, but I did not figure what
went wrong.
>
> No, look at the traceback. The lines it's highlighting
are the ones
> which send the email, and the error message is saying
that it wasn't
> able to establish a connection with your mail server to
send the
> email. Double-check the settings you've provided to
Django for email
> handling and ensure they correctly specify a mail
server that you have
> access to.
>
> --
> "Bureaucrat Conrad, you are technically correct --
the best kind of correct."
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Django users" group.
To post to this group, send email to django-users googlegroups.com
To unsubscribe from this group, send email to
django-users-unsubscribe googlegroups.com
For more options, visit this group at htt
p://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---
|
|
[1-4]
|
|