News for hackers. Stuff that matters.
Re:The Perfect Django Settings File by kilian on Tuesday September 21, 2010 @02:43PM (#1713625)
This is how I do my debug, seems a little more compact :)

   DEBUG = socket.gethostname() != 'your.domain.com'
I'd also suggest you add

   ADMINS = (
       ('name', '[email protected]'),
   )
and

    # Email-settings
    SERVER_EMAIL = '[email protected]'
    if DEBUG:
      EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
    else:
      EMAIL_HOST = 'localhost'
      EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
So you get notified of any errors via e-mail when debug is off.

There are no comments on this comment yet.