Когда
DEBUG=False 404-ая страница отдается нормально, если выставляю
DEBUG=True, то получаю 500-ую ошибку и сообщение
A server error occurred. Please contact the administrator.
Подскажите в какую сторону копать?
Натыкался на то, что проблема может быть в middleware, они у меня объявлены так:
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.cache.UpdateCacheMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.cache.FetchFromCacheMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'django.middleware.gzip.GZipMiddleware',
'django.middleware.http.ConditionalGetMiddleware',
)
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/wsgiref/handlers.py", line 85, in run
self.result = application(self.environ, self.start_response)
File "/Users/or6/PycharmProjects/env/lib/python2.7/site-packages/django/contrib/staticfiles/handlers.py", line 64, in __call__
return self.application(environ, start_response)
File "/Users/or6/PycharmProjects/env/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 187, in __call__
response = self.get_response(request)
File "/Users/or6/PycharmProjects/env/lib/python2.7/site-packages/django/core/handlers/base.py", line 146, in get_response
response = debug.technical_404_response(request, e)
File "/Users/or6/PycharmProjects/env/lib/python2.7/site-packages/django/views/debug.py", line 518, in technical_404_response
'reason': force_bytes(exception, errors='replace'),
File "/Users/or6/PycharmProjects/env/lib/python2.7/site-packages/django/utils/encoding.py", line 150, in force_bytes
errors) for arg in s])
File "/Users/or6/PycharmProjects/env/lib/python2.7/site-packages/django/utils/encoding.py", line 151, in force_bytes
return six.text_type(s).encode(encoding, errors)
UnicodeEncodeError: 'ascii' codec can't encode characters in position 42-45: ordinal not in range(128)
[12/Dec/2014 11:18:04] "GET /js HTTP/1.1" 500 59
UPD: в urls кириллица не используется.