I'm using Django with Apache web server. If I put DEBUG=True Django serves
404 debug errors without problem. But when I put DEBUG=False Apache is
returning a 500 internal server error when it catch a 404 error. This
causes Django to not serve my 404 template (/templates/404.html) and
visitor see the apache internel error instead.
This is what I get in apache error log:
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] mod_wsgi
(pid=10629): Exception occurred processing WSGI script
'/home/user/WEB/app.wsgi'.
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] Traceback (most
recent call last):
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File
"/usr/local/lib/python2.7/dist-packages/django/core/handlers/wsgi.py", line
241, in __call__
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] response =
self.get_response(request)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File
"/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line
153, in get_response
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] response =
self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File
"/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py", line
228, in handle_uncaught_exception
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return
callback(request, **param_dict)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File
"/usr/local/lib/python2.7/dist-packages/django/utils/decorators.py", line
91, in _wrapped_view
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] response =
view_func(request, *args, **kwargs)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File
"/usr/local/lib/python2.7/dist-packages/django/views/defaults.py", line 33,
in server_error
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return
http.HttpResponseServerError(t.render(Context({})))
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File
"/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 140,
in render
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return
self._render(context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File
"/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 134,
in _render
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return
self.nodelist.render(context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File
"/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 823,
in render
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] bit =
self.render_node(node, context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File
"/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 837,
in render_node
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return
node.render(context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File
"/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py",
line 123, in render
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return
compiled_parent._render(context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File
"/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 134,
in _render
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return
self.nodelist.render(context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File
"/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 823,
in render
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] bit =
self.render_node(node, context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File
"/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 837,
in render_node
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return
node.render(context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File
"/usr/local/lib/python2.7/dist-packages/django/template/loader_tags.py",
line 62, in render
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] result =
block.nodelist.render(context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File
"/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 823,
in render
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] bit =
self.render_node(node, context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File
"/usr/local/lib/python2.7/dist-packages/django/template/base.py", line 837,
in render_node
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return
node.render(context)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File
"/usr/local/lib/python2.7/dist-packages/compressor/templatetags/compress.py",
line 147, in render
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] return
self.render_compressed(context, self.kind, self.mode, forced=forced)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File
"/usr/local/lib/python2.7/dist-packages/compressor/templatetags/compress.py",
line 88, in render_compressed
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] cached_offline =
self.render_offline(context, forced=forced)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] File
"/usr/local/lib/python2.7/dist-packages/compressor/templatetags/compress.py",
line 72, in render_offline
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115] 'You may need to
run "python manage.py compress".' % key)
[Mon May 27 13:43:48 2013] [error] [client 10.48.245.115]
OfflineGenerationError: You have offline compression enabled but key
"f105665b075e961e20cfdab086169332" is missing from offline manifest. You
may need to run "python manage.py compress".
I'm using django-compressor with offline compression enabled and running
without problems, I'm not getting any kind of errors when loading "normal"
pages.
Using Django 1.4 on Ubuntu 12.04.2.
Thanks.
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.