【发布时间】:2015-10-15 13:15:43
【问题描述】:
这是一首悲伤的老歌,但有新的信息!
我在共享 Dreamhost 服务器上运行 Django 1.8.3 和 Python 2.7.3 作为 Pythonbrew 安装;通常,使用“python manage.py address.org:8080”一切正常,但在直接导航到站点时无法正常工作,给出一般的 500 内部服务器错误,并且错误日志会提前结束标题消息。
但是,我将 Paste 卡在那里实际上是为了从跟踪中消除错误。
网址:http://staff.gchrl.org/ 调用中的文件'/home/syslib/staff.gchrl.org/staff_site/paste/exceptions/errormiddleware.py',第142行 app_iter = self.application(environ, sr_checker)
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/core/handlers/wsgi.py',调用 response = self.get_response(request)
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/core/handlers/base.py',get_response 中的第 218 行 response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/core/handlers/base.py',handle_uncaught_exception 中的第 261 行 return debug.technical_500_response(request, *exc_info)
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/views/debug.py',technical_500_response 中的第 97 行 html = 记者.get_traceback_html()
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/views/debug.py',get_traceback_html 中的第 384 行 返回 t.render(c)
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/template/base.py',第209行渲染 return self._render(context)
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/template/base.py',_render 中的第 201 行 return self.nodelist.render(context)
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/template/base.py',第903行渲染 bit = self.render_node(node, context)
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/template/debug.py',第79行render_node 返回 node.render(context)
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/template/debug.py',第89行渲染 输出 = self.filter_expression.resolve(context)
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/template/base.py',解析中的第674行 new_obj = func(obj, *arg_vals)
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/template/defaultfilters.py',日期第779行 返回格式(值,arg)
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/dateformat.py',格式为第345行 返回 df.format(format_string)
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/dateformat.py',格式为第37行 pieces.append(force_text(getattr(self,piece)()))
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/dateformat.py',第 270 行 return self.format('D, j M Y H:i:s O')
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/dateformat.py',格式为第37行 pieces.append(force_text(getattr(self,piece)()))
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/encoding.py',第 92 行在 force_text s = 六.text_type(s)
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/functional.py',__text_cast 中的第 141 行 return func(*self.__args, **self.__kw)
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/translation/init.py',行84 在 ugettext return _trans.ugettext(message)
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/translation/trans_real.py',ugettext 中的第 327 行 return do_translate(message, 'ugettext')
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/translation/trans_real.py',do_translate 中的第 304 行 _default = _default 或翻译(settings.LANGUAGE_CODE)
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/translation/trans_real.py',第206行翻译 _translations[语言] = DjangoTranslation(语言)
文件'/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/translation/trans_real.py',init self._add_installed_apps_translations()
文件 '/home/syslib/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/site-packages/django/utils/translation/trans_real.py',_add_installed_apps_translations 中的第 164 行
"翻译基础设施不能在 " AppRegistryNotReady:在应用程序注册表准备好之前无法初始化翻译基础结构。检查您在导入时没有进行非惰性 gettext 调用。
我的passenger_wsgi.py是这样格式化的
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)
【问题讨论】:
-
你的 wsgi 通常有类似
from staff_site.main import app as application -
@JoranBeasley 尝试了该更改,但错误仍然存在。
标签: python django python-2.7 dreamhost