• <small id='lFAT8'></small><noframes id='lFAT8'>

      • <bdo id='lFAT8'></bdo><ul id='lFAT8'></ul>

        <legend id='lFAT8'><style id='lFAT8'><dir id='lFAT8'><q id='lFAT8'></q></dir></style></legend>

        <i id='lFAT8'><tr id='lFAT8'><dt id='lFAT8'><q id='lFAT8'><span id='lFAT8'><b id='lFAT8'><form id='lFAT8'><ins id='lFAT8'></ins><ul id='lFAT8'></ul><sub id='lFAT8'></sub></form><legend id='lFAT8'></legend><bdo id='lFAT8'><pre id='lFAT8'><center id='lFAT8'></center></pre></bdo></b><th id='lFAT8'></th></span></q></dt></tr></i><div id='lFAT8'><tfoot id='lFAT8'></tfoot><dl id='lFAT8'><fieldset id='lFAT8'></fieldset></dl></div>
        <tfoot id='lFAT8'></tfoot>
      1. 接口错误 (0, '')

        时间:2023-06-26
        <tfoot id='Fhl86'></tfoot>

              <bdo id='Fhl86'></bdo><ul id='Fhl86'></ul>

                <tbody id='Fhl86'></tbody>

                <small id='Fhl86'></small><noframes id='Fhl86'>

              1. <i id='Fhl86'><tr id='Fhl86'><dt id='Fhl86'><q id='Fhl86'><span id='Fhl86'><b id='Fhl86'><form id='Fhl86'><ins id='Fhl86'></ins><ul id='Fhl86'></ul><sub id='Fhl86'></sub></form><legend id='Fhl86'></legend><bdo id='Fhl86'><pre id='Fhl86'><center id='Fhl86'></center></pre></bdo></b><th id='Fhl86'></th></span></q></dt></tr></i><div id='Fhl86'><tfoot id='Fhl86'></tfoot><dl id='Fhl86'><fieldset id='Fhl86'></fieldset></dl></div>
                  <legend id='Fhl86'><style id='Fhl86'><dir id='Fhl86'><q id='Fhl86'></q></dir></style></legend>
                • 本文介绍了接口错误 (0, '')的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我使用 Django 构建了一个站点,但在尝试执行查询时收到了这个烦人的错误.

                  I have built a site using Django and I am receiving this annoying error when I am trying to execute a query.

                  如果我重新启动 Apache 服务器,错误会在短时间内消失.

                  If I restart the Apache server, the error will go away for a short time.

                  Traceback:
                  File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
                  100.                     response = callback(request, *callback_args, **callback_kwargs)
                  File "/home/fran/cron/views/set_caches.py" in set_caches
                  24.         cursor.execute(query, [category['id']])
                  File "/usr/local/lib/python2.7/site-packages/django/db/backends/util.py" in execute
                  15.             return self.cursor.execute(sql, params)
                  File "/usr/local/lib/python2.7/site-packages/django/db/backends/mysql/base.py" in execute
                  86.             return self.cursor.execute(query, args)
                  File "build/bdist.linux-i686/egg/MySQLdb/cursors.py" in execute
                  155.         charset = db.character_set_name()
                  
                  Exception Type: InterfaceError at /blablabla/
                  Exception Value: (0, '')
                  

                  推荐答案

                  这是由全局游标引起的.尝试在需要原始查询的每个方法中创建和关闭游标.

                  This is caused by a global cursor. Try creating and closing the cursor within each method a raw query is needed.

                  cursor = connection.cursor()
                  cursor.execute(query)
                  cursor.close()
                  

                  这篇关于接口错误 (0, '')的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:MySQL:何时真正需要 MySQL 中的 Flush Privileges? 下一篇:MySQL:如何选择本周的记录?

                  相关文章

                    <tfoot id='WSiyW'></tfoot>

                      <small id='WSiyW'></small><noframes id='WSiyW'>

                      • <bdo id='WSiyW'></bdo><ul id='WSiyW'></ul>
                    1. <legend id='WSiyW'><style id='WSiyW'><dir id='WSiyW'><q id='WSiyW'></q></dir></style></legend>

                      <i id='WSiyW'><tr id='WSiyW'><dt id='WSiyW'><q id='WSiyW'><span id='WSiyW'><b id='WSiyW'><form id='WSiyW'><ins id='WSiyW'></ins><ul id='WSiyW'></ul><sub id='WSiyW'></sub></form><legend id='WSiyW'></legend><bdo id='WSiyW'><pre id='WSiyW'><center id='WSiyW'></center></pre></bdo></b><th id='WSiyW'></th></span></q></dt></tr></i><div id='WSiyW'><tfoot id='WSiyW'></tfoot><dl id='WSiyW'><fieldset id='WSiyW'></fieldset></dl></div>