1
嗯,我一次又一次得到这个500错误。一切似乎都几天工作,但是当我已经试过立即加载在浏览器的网站,它返回我500 Apache日志不是描述性的,所有我可以看到有:Django和WSGI:错误500再次
Sun May 26 20:39:34 2013] [error] [client 188.134.73.102] mod_wsgi (pid=5087): Exception occurred processing WSGI script '/var/www/empirik/data/www/mywebsite.com.ru/myproject/wsgi.py'.
[Sun May 26 20:39:34 2013] [error] [client 188.134.73.102] Traceback (most recent call last):
[Sun May 26 20:39:34 2013] [error] [client 188.134.73.102] File "/usr/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 241, in __call__
[Sun May 26 20:39:34 2013] [error] [client 188.134.73.102] response = self.get_response(request)
[Sun May 26 20:39:34 2013] [error] [client 188.134.73.102] File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 179, in get_response
[Sun May 26 20:39:34 2013] [error] [client 188.134.73.102] response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Sun May 26 20:39:34 2013] [error] [client 188.134.73.102] File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 228, in handle_uncaught_exception
[Sun May 26 20:39:34 2013] [error] [client 188.134.73.102] return callback(request, **param_dict)
[Sun May 26 20:39:34 2013] [error] [client 188.134.73.102] File "/usr/local/lib/python2.7/site-packages/django/utils/decorators.py", line 91, in _wrapped_view
[Sun May 26 20:39:34 2013] [error] [client 188.134.73.102] response = view_func(request, *args, **kwargs)
[Sun May 26 20:39:34 2013] [error] [client 188.134.73.102] File "/usr/local/lib/python2.7/site-packages/django/views/defaults.py", line 32, in server_error
[Sun May 26 20:39:34 2013] [error] [client 188.134.73.102] t = loader.get_template(template_name) # You need to create a 500.html template.
[Sun May 26 20:39:34 2013] [error] [client 188.134.73.102] File "/usr/local/lib/python2.7/site-packages/django/template/loader.py", line 145, in get_template
[Sun May 26 20:39:34 2013] [error] [client 188.134.73.102] template, origin = find_template(template_name)
[Sun May 26 20:39:34 2013] [error] [client 188.134.73.102] File "/usr/local/lib/python2.7/site-packages/django/template/loader.py", line 138, in find_template
[Sun May 26 20:39:34 2013] [error] [client 188.134.73.102] raise TemplateDoesNotExist(name)
[Sun May 26 20:39:34 2013] [error] [client 188.134.73.102] TemplateDoesNotExist: 500.html
有什么如何获得更具体的信息,然后这个TemplateDoesNotExist异常?
一种方法是临时设置'DEBUG = True',并看到标准的django错误页面,提供了大量有用的信息。另外,考虑定义500.html像建议[这里](http://stackoverflow.com/questions/10639769/how-can-i-find-out-what-500-error-am-i-getting-in-django )。希望有所帮助。 – alecxe