我有一个git存储库,我用于我的django项目。当我在本地更改某些内容时,我将其推送并将其拉到我的“真实”服务器上。我的settings.py文件被忽略,因此没有冲突。然而,在最新拉动之后,我收到以下错误:
[Sun Jul 05 16:59:05 2015] [error] No handlers could be found for logger "django.request"
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] mod_wsgi (pid=30560): Exception occurred processing WSGI script '/home/libraring/webapps/libraring/src/mysite/wsgi.py'.
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] Traceback (most recent call last):
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/core/handlers/wsgi.py", line 187, in __call__
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] response = self.get_response(request)
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/core/handlers/base.py", line 199, in get_response
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] response = self.handle_uncaught_exception(request, resolver, sys.exc_info())
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/core/handlers/base.py", line 236, in handle_uncaught_exception
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] return debug.technical_500_response(request, *exc_info)
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/views/debug.py", line 91, in technical_500_response
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] html = reporter.get_traceback_html()
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/views/debug.py", line 350, in get_traceback_html
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] return t.render(c)
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/template/base.py", line 148, in render
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] return self._render(context)
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/template/base.py", line 142, in _render
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] return self.nodelist.render(context)
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/template/base.py", line 844, in render
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] bit = self.render_node(node, context)
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/template/debug.py", line 80, in render_node
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] return node.render(context)
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/template/debug.py", line 90, in render
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] output = self.filter_expression.resolve(context)
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/template/base.py", line 624, in resolve
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] new_obj = func(obj, *arg_vals)
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/template/defaultfilters.py", line 769, in date
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] return format(value, arg)
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/utils/dateformat.py", line 343, in format
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] return df.format(format_string)
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/utils/dateformat.py", line 35, in format
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] pieces.append(force_text(getattr(self, piece)()))
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/utils/dateformat.py", line 268, in r
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] return self.format('D, j M Y H:i:s O')
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/utils/dateformat.py", line 35, in format
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] pieces.append(force_text(getattr(self, piece)()))
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/utils/encoding.py", line 85, in force_text
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] s = six.text_type(s)
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/utils/functional.py", line 144, in __text_cast
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] return func(*self.__args, **self.__kw)
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/utils/translation/__init__.py", line 83, in ugettext
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] return _trans.ugettext(message)
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/utils/translation/trans_real.py", line 325, in ugettext
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] return do_translate(message, 'ugettext')
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/utils/translation/trans_real.py", line 306, in do_translate
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] _default = translation(settings.LANGUAGE_CODE)
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/utils/translation/trans_real.py", line 209, in translation
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] default_translation = _fetch(settings.LANGUAGE_CODE)
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] File "/home/libraring/webapps/libraring/lib/python2.7/django/utils/translation/trans_real.py", line 189, in _fetch
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] "The translation infrastructure cannot be initialized before the "
[Sun Jul 05 16:59:05 2015] [error] [client 127.0.0.1] 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.
另外,当我打开我的网址时,我收到“内部200错误”。
有趣的是,当我在服务器上运行django应用程序时,它会在本地运行,即。 'python manage.py runserver'我没有得到任何错误。
答案 0 :(得分:0)
您可以使用git reset --hard <OKcommitSHA>
将文件还原到以前的状态。一切都很好的时候OKcommitSHA
是实际的提交密钥。
有关here
的更多详情您还可以使用git diff HEAD <OKcommitSHA>
查看自上次拉动以来应用的更改,从而查看问题所在的位置。