Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django: ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

I have a Django application I want to run locally. I am running on win32 with Python 3.7. I enter the following into Command Prompt on Windows:

$ python manage.py runserver
Django version 2.07, using settings 'web.settings'
Starting development server at http://127.0.0.1:8000
Quit the server with CTRL-BREAK.

The problem comes when I open to localhost:8000/ in my browser. What happens is I'll get this error in Command Prompt:

Traceback (most recent call last):
    File "C:\Program Files\Python37\lib\wsgiref\handlers.py", line 138, in run 
      self.finish_response()
    File "C:\Program Files\Python37\lib\wsgiref\handlers.py", line 180, in finish_response()
      self.write(data)
    File "C:\Programs Files\Python37\lib\wsgiref\handlers.py", line 279, in write
      self.write(data)
    File "C:\Programs Files\Python37\lib\wsgiref\handlers.py", line 453, in _write
      result = self.stdout.write(data)
    File "C:\Programs Files\Python37\lib\socketserver.py", line 796, in write
      self._sock.sendall(b)
 ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

I am unsure how to get rid of this error.

like image 985
CodeRocks Avatar asked Jan 31 '19 16:01

CodeRocks


1 Answers

If you're using PostgreSQL on Windows, you may have a code page issue.

>psql -U postgres
psql (9.6)
WARNING: Console code page (850) differs from Windows code page (1252)
     8-bit characters might not work correctly. See psql reference
     page "Notes for Windows users" for details.
Type "help" for help.

postgres=#

Please try setting code page before launching Django.

> cmd.exe /c chcp 1252
like image 162
Elthari Avatar answered Sep 29 '22 21:09

Elthari