Django error report not being sent through email

363 views
Skip to first unread message

Xin Ji

unread,
Sep 19, 2015, 11:49:56 AM9/19/15
to Django users
I'm using apache + django + mod_wsgi to serve my app.
My apache version is 2.4.7 and my django version is 1.8.4

My django settings are:
  DEBUG=False

  ADMINS = [
      ('username','user...@comp.nus.edu.sg'),
  ]

  MANAGERS = [
      ('username','user...@comp.nus.edu.sg'),
  ]

  MIDDLEWARE_CLASSES = (
      ...
      'django.middleware.common.BrokenLinkEmailsMiddleware',
  )

  EMAIL_HOST = 'stmp.comp.nus.edu.sg'
  EMAIL_PORT = 25
  EMAIL_HOST_USER = 'username'
  EMAIL_HOST_PASSWORD = 'password'


When I ran the server, I got this error on the website(This page uses the django 500.html template.):

Server Error (500)

There's been an error. It's been reported to the site administrators via email and should be fixed shortly. Thanks for your patience.


But I didn't receive any email about the error report.

What's wrong with my configurations?

Gergely Polonkai

unread,
Sep 19, 2015, 12:06:46 PM9/19/15
to Django users
Hello,

BrokenLinkEmailsMiddleware sends error reports about 404 errors.

500 errors are reported via logging. Have you overridden the LOGGING setting?

Best,
Gergely

--
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/24b158eb-c6f3-4928-8588-391484139734%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Xin Ji

unread,
Sep 19, 2015, 12:27:06 PM9/19/15
to Django users
No, I haven't.
How should I override? And Which file should I put the LOGGING settings in?

在 2015年9月19日星期六 UTC+8下午7:49:56,Xin Ji写道:
I'm using apache + django + mod_wsgi to serve my app.
My apache version is 2.4.7 and my django version is 1.8.4

My django settings are:
  DEBUG=False

  ADMINS = [
      ('username','username@comp.nus.edu.sg'),
  ]

  MANAGERS = [
      ('username','username@comp.nus.edu.sg'),

  ]

  MIDDLEWARE_CLASSES = (
      ...
      'django.middleware.common.BrokenLinkEmailsMiddleware',
  )

  EMAIL_HOST = 'stmp.comp.nus.edu.sg'
  EMAIL_PORT = 25
  EMAIL_HOST_USER = 'username'
  EMAIL_HOST_PASSWORD = 'password'

Gergely Polonkai

unread,
Sep 19, 2015, 9:51:19 PM9/19/15
to Django users

It belongs to settings.py, as everything else. However, if you haven't overridden it, it should send yeu the emails. Are you sure your e-mail sender settings are set properly?

Best,
Gergely

On 19 Sep 2015 14:27, "Xin Ji" <vincen...@gmail.com> wrote:
No, I haven't.
How should I override? And Which file should I put the LOGGING settings in?

在 2015年9月19日星期六 UTC+8下午7:49:56,Xin Ji写道:
I'm using apache + django + mod_wsgi to serve my app.
My apache version is 2.4.7 and my django version is 1.8.4

My django settings are:
  DEBUG=False

  ADMINS = [
      ('username','user...@comp.nus.edu.sg'),
  ]

  MANAGERS = [
      ('username','user...@comp.nus.edu.sg'),

  ]

  MIDDLEWARE_CLASSES = (
      ...
      'django.middleware.common.BrokenLinkEmailsMiddleware',
  )

  EMAIL_HOST = 'stmp.comp.nus.edu.sg'
  EMAIL_PORT = 25
  EMAIL_HOST_USER = 'username'
  EMAIL_HOST_PASSWORD = 'password'


When I ran the server, I got this error on the website(This page uses the django 500.html template.):

Server Error (500)

There's been an error. It's been reported to the site administrators via email and should be fixed shortly. Thanks for your patience.


But I didn't receive any email about the error report.

What's wrong with my configurations?

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

Luis Zárate

unread,
Sep 20, 2015, 1:22:56 AM9/20/15
to django...@googlegroups.com
Your SMTP server are not using TLS or ssl ?
> To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CACczBUKqJ6yeTQGYN19-imzikrPsbY2PgLHXJVhaEXSS2QkRLw%40mail.gmail.com.

> For more options, visit https://groups.google.com/d/optout.
>

--
"La utopía sirve para caminar" Fernando Birri



Daniel Rus Morales

unread,
Sep 20, 2015, 10:31:30 AM9/20/15
to django...@googlegroups.com
Hi Xin,

Maybe the server from which you are running the project can’t send emails.
I would try to send an email using the send_mail function from the shell:

$ python manage.py shell
>>> from django.core.mail import send_mail
>>> send_mail(’the subject’, ’the message’, ‘fr...@example.com’, [’t...@you.com’,])

It shouldn’t take more than a couple of seconds. If the session hangs I would look at the email settings (EMAIL_HOST, EMAIL_PORT, EMAIL_HOST_USER, and EMAIL_HOST_PASSWORD), maybe a sysadmin could tell you which values you must use to reach the network outside of your local network. Also the EMAIL_BACKEND must be django.core.mail.backends.smtp.EmailBackend.

If the function returns 1, then you were able to contact the SMTP server and deliver the message successfully to the server. However a misconfiguration in the SMTP Server might stop the outgoing message from reaching the mail server of your email address.

Give it a try and let us know.

 

Rob Groves

unread,
Sep 20, 2015, 11:25:32 AM9/20/15
to Django users
I'm not sure if it is a typo... but your have:
  EMAIL_HOST = 'stmp.comp.nus.edu.sg'
Should that be:
  EMAIL_HOST = 'smtp.comp.nus.edu.sg'
Reply all
Reply to author
Forward
0 new messages