简体   繁体   中英

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.

What is your Django package version?

There is exception in django project like yours https://github.com/django/django/commit/934acf1126995f6e6ccba5947ec8f7561633c27f

Try to update django to newest version

pip install --update django

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:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM