0

在 linux 服务器机智和 mod_wsgi 上部署我的 django 应用程序后,我遇到以下错误 -

[Wed Apr 10 05:21:52 2013] [error] [client 117.199.125.229] mod_wsgi (pid=20033): Exception occurred processing WSGI script '/var/www/html/appletrade/django.wsgi'.
[Wed Apr 10 05:21:52 2013] [error] [client 117.199.125.229] Traceback (most recent call last):
[Wed Apr 10 05:21:52 2013] [error] [client 117.199.125.229]   File "usr/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 272, in __call__
[Wed Apr 10 05:21:52 2013] [error] [client 117.199.125.229]     response = self.get_response(request)
[Wed Apr 10 05:21:52 2013] [error] [client 117.199.125.229]   File "usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 169, in get_response
[Wed Apr 10 05:21:52 2013] [error] [client 117.199.125.229]     response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Wed Apr 10 05:21:52 2013] [error] [client 117.199.125.229]   File "usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 218, in handle_uncaught_exception
[Wed Apr 10 05:21:52 2013] [error] [client 117.199.125.229]     return callback(request, **param_dict)
[Wed Apr 10 05:21:52 2013] [error] [client 117.199.125.229]   File "usr/lib/python2.6/site-packages/django/utils/decorators.py", line 93, in _wrapped_view
[Wed Apr 10 05:21:52 2013] [error] [client 117.199.125.229]     response = view_func(request, *args, **kwargs)
[Wed Apr 10 05:21:52 2013] [error] [client 117.199.125.229]   File "usr/lib/python2.6/site-packages/django/views/defaults.py", line 30, in server_error
[Wed Apr 10 05:21:52 2013] [error] [client 117.199.125.229]     t = loader.get_template(template_name) # You need to create a 500.html template.
[Wed Apr 10 05:21:52 2013] [error] [client 117.199.125.229]   File "usr/lib/python2.6/site-packages/django/template/loader.py", line 157, in get_template
[Wed Apr 10 05:21:52 2013] [error] [client 117.199.125.229]     template, origin = find_template(template_name)
[Wed Apr 10 05:21:52 2013] [error] [client 117.199.125.229]   File "usr/lib/python2.6/site-packages/django/template/loader.py", line 138, in find_template
[Wed Apr 10 05:21:52 2013] [error] [client 117.199.125.229]     raise TemplateDoesNotExist(name)
[Wed Apr 10 05:21:52 2013] [error] [client 117.199.125.229] TemplateDoesNotExist: 500.html

我无法获得我错过的配置。请帮我。

如果需要有关配置的更多信息,请告诉我。

4

1 回答 1

1

在 debug=False 时部署 Django。您必须500.html在您的模板路径之一中包含一个模板。您可以只创建一个名为的空文件500.html

文档中的更多信息:

https://docs.djangoproject.com/en/dev/topics/http/views/#the-500-server-error-view

于 2013-04-10T01:36:17.000 回答