2

I have a Django (1.7) project deployed on Debian, using Apache2 (2.2.2) and mod_wsgi (4.4.1). My 000-default file looks like

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /mnt/web
    RewriteEngine  on

    WSGIDaemonProcess wechat python-path=/mnt/web/wechat:/usr/local/lib/python2.7/site-packages
    WSGIScriptAlias /wechat /mnt/web/wechat/wechat/wsgi.py
    WSGIProcessGroup wechat
</VirtualHost>

And my wsgi.py file looks like

import os
os.environ["DJANGO_SETTINGS_MODULE"] = "wechat.settings"

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

Even when I set DEBUG = True, It shows 500 Internal Server Error if something goes wrong. How can I get the debug page back or is there a easy way to setting and see the error log?

Update: I have fixed this problem. Thanks to Bruno's answer, I found out that it's django.core.exceptions.AppRegistryNotReady problem, which has been solved here.

Community
  • 1
  • 1
Nathaniel Ding
  • 166
  • 1
  • 10

1 Answers1

4

Error reporting in django is fully documented here:

https://docs.djangoproject.com/en/1.7/howto/error-reporting/

and here:

https://docs.djangoproject.com/en/1.7/topics/logging/

Note that if the error happens outside django itself (ie in your apache conf or wsgi script), all you'll get is apache's own error log. The fact you don't have the debug page despite DEBUG=True might come from such a kind of problem.

bruno desthuilliers
  • 75,974
  • 6
  • 88
  • 118