【问题标题】:connectionreseterror: (errno 104) connection reset by peerconnectionreseterror: (errno 104) 连接被对等方重置
【发布时间】:2021-03-20 05:59:58
【问题描述】:

我正在开发一个 Django 网络项目。前一刻一切都很好,但突然 django localhost 服务器保持自身重新加载并且没有停止自动重新加载页面。首先我收到以下错误:connectionreseterror: (errno 104) connection reset by peer 服务器只是一遍又一遍地重新加载自己。这可能是什么原因?任何帮助将不胜感激。

【问题讨论】:

  • 谁能帮忙?

标签: python django server connection peer


【解决方案1】:

你的 Django 包版本是什么?

像你这样的 django 项目有异常 https://github.com/django/django/commit/934acf1126995f6e6ccba5947ec8f7561633c27f

尝试将 django 更新到最新版本

pip install --update django

【讨论】:

    【解决方案2】:

    已解决。 我正在使用 JQuery 自动完成从后端搜索数据,并希望实现将用户重定向到该特定项目页面的 onclick 功能。

    $(document).ready(function() {
            $("#search").autocomplete({
                source: "{% url 'ajax-search' %}",
                select: function (event, ui) {
                    window.location.href = ui.item.value;
                }
            })
            window.location.href = ''
        });
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <div class="search">
                    <label for="search"></label><input type="text" oninput="" style="height: 36px" class="searchTerm"
                                                       placeholder="What are you looking for?" name="searchtext"
                                                       id="search"><input type="hidden" id="project-id">
                    <button type="submit" class="searchButton">
                        <i class="fa fa-search"></i>
                    </button>
                </div>

    并且问题符合要求:

    window.location.href = ''

    我删除了那行代码,现在一切都很好:)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-10-10
      • 2014-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-03
      • 2018-05-22
      相关资源
      最近更新 更多