亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

帶有psycopg2的Django 1.5拋出隨機錯誤

帶有psycopg2的Django 1.5拋出隨機錯誤

Cats萌萌 2021-03-29 18:10:01
我面臨一些奇怪的問題。當我為Django應用程序運行單個worker時?像這樣:python manage.py run_gunicorn -w 1python manage.py runserver所有請求均正確滿足,但如果啟動多個工作程序,例如:python manage.py run_gunicorn -w 10Django對(大約)我的請求的一半做出錯誤回應:2013-06-13 18:02:39 [10205] [ERROR] Error handling requestTraceback (most recent call last):  File "/home/mezhenin/venv/karma/local/lib/python2.7/site-packages/gunicorn/workers/sync.py", line 130, in handle_request    for item in respiter:  File "/home/mezhenin/venv/karma/local/lib/python2.7/site-packages/raven/middleware.py", line 27, in __call__    iterable = self.application(environ, start_response)  File "/home/mezhenin/venv/karma/local/lib/python2.7/site-packages/django/core/handlers/wsgi.py", line 255, in __call__    response = self.get_response(request)  File "/home/mezhenin/venv/karma/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 177, in get_response    signals.got_request_exception.send(sender=self.__class__, request=request)  File "/home/mezhenin/venv/karma/local/lib/python2.7/site-packages/django/dispatch/dispatcher.py", line 170, in send    response = receiver(signal=self, sender=sender, **named)  File "/home/mezhenin/venv/karma/local/lib/python2.7/site-packages/django/db/__init__.py", line 68, in _rollback_on_exception    transaction.rollback_unless_managed(using=conn)  File "/home/mezhenin/venv/karma/local/lib/python2.7/site-packages/django/db/transaction.py", line 143, in rollback_unless_managed    connection.rollback_unless_managed()  File "/home/mezhenin/venv/karma/local/lib/python2.7/site-packages/django/db/backends/__init__.py", line 232, in rollback_unless_managed    self._rollback()  File "/home/mezhenin/venv/karma/local/lib/python2.7/site-packages/django/db/backends/__init__.py", line 59, in _rollback    return self.connection.rollback()OperationalError: no connection to the server我嘗試將sqlite3用作Django的數據庫后端,并且工作正常。有人對psycopg2有相同的問題嗎?Django==1.5gunicorn==0.17.2psycopg2==2.5
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 163 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號