How to see details of Django errors with Gunicorn?

后端 未结 5 1598
无人及你
无人及你 2021-01-31 08:33

I just deployed my Django (1.6) project with gunicorn and Nginx.

It seems to be working fine but I have one page were I\'m getting an HTTP 500 error and I can\'t find an

5条回答
  •  醉话见心
    2021-01-31 09:07

    The simplest solution is to configure the variable ADMINS with email addresses of people who should get error notifications. When DEBUG=False and a view raises an exception, Django will email these people with the full exception information.

    settings.py

    ADMINS = (('John', 'john@example.com'), ('Mary', 'mary@example.com'))
    # or only ADMINS = (('John', 'john@example.com'),)
    

    Maybe you need also EMAIL_HOST and EMAIL_PORT if the right SMTP server is not localhost on port 25. This simple solution is good enough for trial production operation, otherwise it can produce suddenly too much emails.

提交回复
热议问题