Django runserver shows ERR_CONNECTION_RESET (tried multiple ports)

Hi everyone :waving_hand:,

I’m totally new to Django and web development. I’m learning it at a computer school, but I’m basically a beginner and my exams are coming up soon. Sadly, my teacher isn’t helping much, so I’m trying to figure things out on my own.

When I run my project with:

python manage.py runserver

the terminal shows no errors — Django says it’s running on http://127.0.0.1:8000/ — but when I open that in my browser, I get:
ERR_CONNECTION_RESET

What I’ve tried:

  • Tested 127.0.0.1:8000, localhost:8000, 0.0.0.0:8000 → all same error

  • Tried other ports like 8080 → same

  • Allowed firewall access

  • Fresh install of Django (5.2.6) and Python (3.11) on Windows 11

But it still won’t load :sob:

Any beginner-friendly help would mean a lot :folded_hands:

Just to confirm your issue, do this again:

Start Django on the terminal. Do you see any messages on the terminal indicating that Django has started?

If so, … Open your browser and type the following on the address bar.

http://127.0.0.1:8000

Run it. What do you see on both the browser and the terminal?

If nothing changes on the terminal, check the following:

  1. Does the computer browse at all (normally, i.e. without Django)?

  2. Is something (e.g. a firewall) blocking port 8000?

Hi, thanks a lot for taking the time to help :folded_hands:

When I start Django with python manage.py runserver, I do see this in the terminal:

System check identified no issues (0 silenced).
Django version 5.2.5, using settings 'StudentERP.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.

But when I open http://127.0.0.1:8000 in my browser (Edge and Chrome), I get:

Hmmm… can’t reach this page
ERR_CONNECTION_RESET

The terminal also logs messages like:

[27/Aug/2025 14:57:56,986] - Broken pipe from ('127.0.0.1', 23878)

My internet works normally outside Django (I can browse sites).
I also tried changing the port (e.g. runserver 8001) and turning off the firewall temporarily, but the same issue happens.

Do you have any other ideas I could try?

Please describe your environment. What operating system / version are you using?

The way you phrase this gives me the impression that there are more messages on the console? (If so, please post the complete output starting from the python command being used to run the server through the last line emitted as a result of your attempt to connect.

1 Like

Hi, thanks for following up :folded_hands:

I’m on Windows 11 (Version 23H2, build 22631) and using:

  • Python 3.11.9 (64-bit) (installed from python.org)
  • Django 5.2.5
  • Running inside VS Code PowerShell terminal

When I start the server with: python manage.py runserver

I get this output in the terminal:
System check identified no issues (0 silenced).
August 27, 2025 - 14:57:27
Django version 5.2.5, using settings ‘StudentERP.settings’
Starting development server at 127 dot 0 dot 0 dot 1 : 8000
Quit the server with CTRL-BREAK.
WARNING: This is a development server. Do not use it in a production setting.
(see docs [dot] djangoproject [dot] com, deployment section)
[27/Aug/2025 14:57:56,986] - Broken pipe from (‘127.0.0.1’, 23878)
[27/Aug/2025 14:57:57,167] - Broken pipe from (‘127.0.0.1’, 23879)
[27/Aug/2025 14:57:57,741] - Broken pipe from (‘127.0.0.1’, 23880)
[27/Aug/2025 14:57:57,743] - Broken pipe from (‘127.0.0.1’, 23881)
[27/Aug/2025 14:58:02,785] - Broken pipe from (‘127.0.0.1’, 23889)
[27/Aug/2025 14:58:02,805] - Broken pipe from (‘127.0.0.1’, 23890)

When I open 127 dot 0 dot 0 dot 1 : 8000 in my browser (Edge/Chrome), I see:
Hmmm… can’t reach this page
ERR_CONNECTION_RESET

That’s the full output I see after trying to connect.

Side note: When you’re posting code or other preformatted text such as console output, enclose it between lines of three backtick - ` characters. This means you’ll have a line of ```, then the text, then another line of ```. This allows you to post text including things like http://127.0.0.1:8000 without it attempting to be rendered as a link so that you don’t need to manually obfuscate it.

Example:
(The line after this is ```)

(p313) PS C:\Users\tskww\git\pb> py manage.py runserver 0.0.0.0:8000
Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
September 13, 2025 - 22:01:05
Django version 5.2.6, using settings 'mysite.settings'
Starting development server at http://0.0.0.0:8000/
Quit the server with CTRL-BREAK.

WARNING: This is a development server. Do not use it in a production setting. Use a production WSGI or ASGI server instead.
For more information on production servers see: https://docs.djangoproject.com/en/5.2/howto/deployment/
Not Found: /
[13/Sep/2025 22:01:18] "GET / HTTP/1.1" 404 2666

(The line above this is ```)

I’m currently unable to recreate the symptoms you are reporting here.

What is the actual command line that you are using to run the server?

Are you running this in a virtual environment?

Also, I might suggest you try running it from within the command prompt window and not powershell.

Also, is this a “managed” system in which someone else has control over the computer? (Such as on an Active Directory Domain or some other security infrastructure?)

Hi Ken, thanks for following up :folded_hands:

I’m running:

PS C:\Users\USER\Desktop\StudentSystem\studentERP> python manage.py runserver 0.0.0.0:8001

Output:

Watching for file changes with StatReloader
Performing system checks...

System check identified no issues (0 silenced).
September 17, 2025 - 13:04:57
Django version 5.2.5, using settings 'StudentERP.settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.

WARNING: This is a development server. Do not use it in a production setting. Use a production WSGI or ASGI server instead.
For more information on production servers see: https://docs.djangoproject.com/en/5.2/howto/deployment/
[17/Sep/2025 13:05:21,077] - Broken pipe from ('127.0.0.1', 15579)
[17/Sep/2025 13:05:21,123] - Broken pipe from ('127.0.0.1', 15580)
[17/Sep/2025 13:05:22,140] - Broken pipe from ('127.0.0.1', 15581)
[17/Sep/2025 13:05:22,148] - Broken pipe from ('127.0.0.1', 15582)
[17/Sep/2025 13:05:22,149] - Broken pipe from ('127.0.0.1', 15583)

Performing system checks…

System check identified no issues (0 silenced).

August 27, 2025 - 14:57:27

Django version 5.2.5, using settings ‘StudentERP.settings’

Starting development server at http://0.0.0.0:8001/

Quit the server with CTRL-BREAK.

WARNING: This is a development server. Do not use it in a production setting.

For more information on production servers see: How to deploy Django | Django documentation | Django

[27/Aug/2025 14:57:56,986] - Broken pipe from (‘127.0.0.1’, 23878)[27/Aug/2025 14:57:57,167] - Broken pipe from (‘127.0.0.1’, 23879)


When I try http://127.0.0.1:8001/

in my browser, I still get:

> Hmmm… can’t reach this page
>
> ERR_CONNECTION_RESET

To answer your questions:

Yes, I’m inside a virtual environment (venv created in the project folder).

I’m on Windows 11 Home, Version 23H2 (Build 22631).

Python 3.11.9 (installed from python.org).

Django 5.2.5.

I normally run this inside VS Code’s PowerShell terminal.

I also tried from Windows Command Prompt with the same results.

This is my personal laptop, not managed by a school or company network/domain.

Please post your project’s INSTALLED_APPS and MIDDLEWARE settings, along with the contents of your wsgi.py file and the complete output of a python -m pip list command.

Hi Ken, thanks again for helping :folded_hands:

Here are the details you asked for:

INSTALLED_APPS (from settings.py):

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'studentapp',
]

MIDDLEWARE (from settings.py):

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

wsgi.py:

"""
WSGI config for studentsystem project.

It exposes the WSGI callable as a module-level variable named ``application``.

For more information on this file, see
https://docs.djangoproject.com/en/5.2/howto/deployment/wsgi/
"""

import os

from django.core.wsgi import get_wsgi_application

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'studentsystem.settings')

application = get_wsgi_application()

pip list (inside venv):

(venv) C:\Users\USER\Desktop\StudentSystem\StudentERP>python -m pip list
Package    Version
---------- -------
asgiref    3.9.1
Django     5.2.5
pip        25.2
setuptools 65.5.0
sqlparse   0.5.3
tzdata     2025.2

Thanks so much for taking the time to guide me

Hi Ken (or anyone else), I am sorry I did not reply to you on time. I was very busy that week. just checking if there’s any update on this issue. I’m still getting ERR_CONNECTION_RESET when running the Django server. Thanks for your time :folded_hands:.

There are a couple things that don’t seem right.

In your wsgi.py file, you have:

But the console log you posted has:

This leads me to believe you might have some files mixed up between two different projects.

Please post the output of a python manage.py showmigrations

Please post the contents of your urls.py file.

Please post the output of a “tree” command from your project directory.

Thanks, Ken!
I checked again — the folder name is actually StudentERP, but I usually type it in lowercase (studenterp) when changing directories because I’m lazy to type the capital letters :sweat_smile:.

Here’s the info you asked for:

python manage.py showmigrations

admin
 [X] 0001_initial
 [X] 0002_logentry_remove_auto_add
 [X] 0003_logentry_add_action_flag_choices
auth
 [X] 0001_initial
 [X] 0002_alter_permission_name_max_length
 ...
studentapp
 [X] 0001_initial

urls.py

from django.urls import path
from .views import *

urlpatterns = [
    path('', mylogin, name='mylogin'),
    path('dashboard', dashboard, name='dashboard'),
    path('add', addstudent, name='addstudent'),
    path('users', createusers, name='createusers'),
    path('allstudents', viewstudents, name='viewstudents'),
    path('delete/<int:id>/', deletestudent, name='deletestudent'),
    path('edit/<int:id>/', editstudent, name='editstudent'),
]

Folder structure

C:\Users\USER\Desktop\StudentSystem\StudentERP
├── db.sqlite3
├── manage.py
├── studentapp
│   ├── admin.py
│   ├── models.py
│   ├── views.py
│   ├── urls.py
│   └── templates
│       ├── login.html
│       ├── dashboard.html
│       ├── addstudent.html
│       └── ...

Does the uppercase/lowercase folder naming matter here, or should I check something else in my project structure?

This:

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'studentsystem.settings')
                                                 ^^^^^^^^^^^^^

Is not a reference to the same directory as this:

Django version 5.2.5, using settings 'StudentERP.settings'
                                      ^^^^^^^^^^

It’s not an issue of upper vs lower case, they’re different names.

Please show the complete directory and file listing for your projects - I think you may have some structural issues.

Also post the contents of your manage.py file.