pythondjangoserverconnectionpeer

connectionreseterror: (errno 104) connection reset by peer


I am working on a Django web project. One moment before all was good but suddenly django localhost server kept itself reloading and not stopping auto-reloading the pages. First I got the following error: connectionreseterror: (errno 104) connection reset by peer And the server just kept reloading itself over and over again. What could be the cause for this? Any help will be appreciated.


Solution

  • SOlved. I was using JQuery autocomplete to search data from backend and wanted to implement onclick functionality that redirects the user to that specific item page.

    $(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>

    and Issue was in line :

    window.location.href = ''

    I removed that line of code and now it's all good :)