It's the same old sad song, with new info!
I'm running Django 1.8.3 with Python 2.7.3 as a Pythonbrew install on a shared Dreamhost server; as is common, everything works fine with "python manage.py address.org:8080", but isn't working when the site is navigated to directly, giving a generic 500 Internal Server Error, and the error logs give a premature end of header message.
However, I stuck Paste in there to actually get the errors being kicked back from the trace.
URL: http://staff.gchrl.org/ File '/home/syslib/staff.gchrl.org/staff_site/paste/exceptions/errormiddleware.py', line 142 in call app_iter = self.application(environ, sr_checker)
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/core/handlers/wsgi.py', line 189 in call response = self.get_response(request)
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/core/handlers/base.py', line 218 in get_response response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/core/handlers/base.py', line 261 in handle_uncaught_exception return debug.technical_500_response(request, *exc_info)
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/views/debug.py', line 97 in technical_500_response html = reporter.get_traceback_html()
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/views/debug.py', line 384 in get_traceback_html return t.render(c)
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/template/base.py', line 209 in render return self._render(context)
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/template/base.py', line 201 in _render return self.nodelist.render(context)
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/template/base.py', line 903 in render bit = self.render_node(node, context)
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/template/debug.py', line 79 in render_node return node.render(context)
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/template/debug.py', line 89 in render output = self.filter_expression.resolve(context)
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/template/base.py', line 674 in resolve new_obj = func(obj, *arg_vals)
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/template/defaultfilters.py', line 779 in date return format(value, arg)
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/dateformat.py', line 345 in format return df.format(format_string)
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/dateformat.py', line 37 in format pieces.append(force_text(getattr(self, piece)()))
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/dateformat.py', line 270 in r return self.format('D, j M Y H:i:s O')
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/dateformat.py', line 37 in format pieces.append(force_text(getattr(self, piece)()))
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/encoding.py', line 92 in force_text s = six.text_type(s)
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/functional.py', line 141 in __text_cast return func(*self.__args, **self.__kw)
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/translation/init.py', line 84 in ugettext return _trans.ugettext(message)
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/translation/trans_real.py', line 327 in ugettext return do_translate(message, 'ugettext')
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/translation/trans_real.py', line 304 in do_translate _default = _default or translation(settings.LANGUAGE_CODE)
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/translation/trans_real.py', line 206 in translation _translations[language] = DjangoTranslation(language)
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/translation/trans_real.py', line 116 in init self._add_installed_apps_translations()
File '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/translation/trans_real.py', line 164 in _add_installed_apps_translations
"The translation infrastructure cannot be initialized before the " AppRegistryNotReady: The translation infrastructure cannot be initialized before the apps registry is ready. Check that you don't make non-lazy gettext calls at import time.
My passenger_wsgi.py is formatted thusly
import sys, os
INTERP = "/home/syslib/.pythonbrew/pythons/Python-2.7.3/bin/python"
#INTERP is present twice so that the new python interpreter knows the actual executable path
if sys.executable != INTERP: os.execl(INTERP, INTERP, *sys.argv)
sys.path.insert(0, os.getcwd(), "staff_site")
os.environ['DJANGO_SETTINGS_MODULE'] = "staff_site.settings"
from paste.exceptions.errormiddleware import ErrorMiddleware
import django.core.handlers.wsgi
DjangoApp = django.core.handlers.wsgi.WSGIHandler()
application = ErrorMiddleware(DjangoApp, debug=True)
from staff_site.main import app as application
– Joran Beasley