127.0.0.1 refused to connect.

1,507 views
Skip to first unread message

Parul.

unread,
Dec 18, 2020, 11:29:25 AM12/18/20
to Django users
i am not able to connect , i tried to use 0.0.0.0:8000 , 0.0.0.0:8080 as well, still getting same error. 
used 127.0.0.1 with ports 8000 and 8080 still getting error 
i have put '*' in ALLOWED_HOSTS

Akanimoh Osutuk

unread,
Dec 18, 2020, 12:29:59 PM12/18/20
to django...@googlegroups.com
What errors are you getting?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/b6e49e34-46f1-4c5f-9829-358b3323d381n%40googlegroups.com.

Parul.

unread,
Dec 18, 2020, 12:38:06 PM12/18/20
to django...@googlegroups.com
This is the error which I am getting.

IMG_20201218_230247.jpg

Frank Chukka

unread,
Dec 18, 2020, 12:55:11 PM12/18/20
to django...@googlegroups.com

Is it that your local server is running but you're unable to access the requested page or "python manage.py runserver" command is not running d server? A little bit of information will be very helpful

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

Akanimoh Osutuk

unread,
Dec 18, 2020, 12:57:34 PM12/18/20
to django...@googlegroups.com
The port is probably being used by another app. Are u running other development servers?

Parul.

unread,
Dec 18, 2020, 1:12:20 PM12/18/20
to django...@googlegroups.com
I am using the command python manage.py runserver
But it is not running the servers
I tried localhost with 8000 and 8080 also
The tried 0.0.0.0:8000 and with 8080


I am not running any other servers.

While checking the ip4 in cmd...it's showing 192.168.1.11 ....tried python manage.py runserver with this also but didn't work.

Dhruvil Shah

unread,
Dec 18, 2020, 1:24:15 PM12/18/20
to django...@googlegroups.com
Try uninstalling django and re-install it

Kasper Laudrup

unread,
Dec 18, 2020, 4:39:55 PM12/18/20
to django...@googlegroups.com
On 18/12/2020 19.22, Dhruvil Shah wrote:
> Try uninstalling django and re-install it
>

And if that doesn't work try reinstalling the operating system. If it
still doesn't work, try buying a new computer.

Computers are black magic after all and no one really knows how they work.

Kasper Laudrup

unread,
Dec 18, 2020, 4:43:21 PM12/18/20
to django...@googlegroups.com
Hi Parul,

On 18/12/2020 19.10, Parul. wrote:
> I am using the command python manage.py runserver
> But it is not running the servers

What does it mean that it's not running the servers? Are you getting any
errors?

> I am not running any other servers.
>

You most likely are, but probably not something bound to that port.

> While checking the ip4 in cmd...it's showing 192.168.1.11 ....tried
> python manage.py runserver with this also but didn't work.
>

What do you mean by "ip4 in cmd"? Are you running Windows? Then that's
probably something you should mention if you want someone to help you.

Kind regards,

Kasper Laudrup

hari49pf

unread,
Dec 18, 2020, 10:47:26 PM12/18/20
to django...@googlegroups.com, Kasper Laudrup
try HTTPS connection and check.
--
Regards,
Harish.Bheemanpally,
Mob: 9849111831.

Frank Chukka

unread,
Dec 18, 2020, 11:42:57 PM12/18/20
to django...@googlegroups.com

try running the server without including the ip or port,just run "python manage.py runserver" only.

The way I tend to solve problems like this is I reduce the search space by ruling out what is obviously not the issue(e.g I don't think you have to reinstall your os or that it has anything to do with https since you're running locally) next I look at the error message(especially the last line in cmd) then I do a little bit of Googling.just keep ruling out what didn't work eventually you will arrive at d solution.for example,you can startup a new project in a virtual environment n run the server of the new project,if you don't get the error again you can be rest assured the error has to do with the specific project you're working but if you do then the next suspect should probably be your os.since the server is not running at all that rules out the Web browser.

Just be patient,chop it off bit by bit and you will eventually get there.best of luck

On 18 Dec 2020 7:11 pm, "Parul." <parul....@gmail.com> wrote:
I am using the command python manage.py runserver
But it is not running the servers
I tried localhost with 8000 and 8080 also
The tried 0.0.0.0:8000 and with 8080


I am not running any other servers.

While checking the ip4 in cmd...it's showing 192.168.1.11 ....tried python manage.py runserver with this also but didn't work.

On Fri, Dec 18, 2020, 11:27 PM Akanimoh Osutuk <akani...@gmail.com> wrote:
The port is probably being used by another app. Are u running other development servers?

On Fri, 18 Dec 2020, 18:34 Parul., <parul....@gmail.com> wrote:
This is the error which I am getting.

On Fri, Dec 18, 2020, 10:59 PM Akanimoh Osutuk <akani...@gmail.com> wrote:
What errors are you getting?

On Fri, 18 Dec 2020, 17:28 Parul., <parul....@gmail.com> wrote:
i am not able to connect , i tried to use 0.0.0.0:8000 , 0.0.0.0:8080 as well, still getting same error. 
used 127.0.0.1 with ports 8000 and 8080 still getting error 
i have put '*' in ALLOWED_HOSTS

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHjHRFo%3DiW576Jyxz234HdmfxDb8X7qR8NF-sOp6%3DZv39eeo3g%40mail.gmail.com.

Parul.

unread,
Dec 20, 2020, 5:27:48 AM12/20/20
to django...@googlegroups.com
Hy,
I am not able to indentify the exact problem here. I tried various combinations like using only 
Python manage.py runserver
Then
Python manage.py runserver 8080 /8000 

Still getting the error message as 
"Refused to connect "


This has really become an obstacle for me as I am not able to continue further. 
I tried all the above suggestions except uninstalling django... considering that as my last option ..
Please help.... 


On Sat, Dec 19, 2020, 10:12 AM Frank Chukka <frankc...@gmail.com> wrote:

try running the server without including the ip or port,just run "python manage.py runserver" only.

The way I tend to solve problems like this is I reduce the search space by ruling out what is obviously not the issue(e.g I don't think you have to reinstall your os or that it has anything to do with https since you're running locally) next I look at the error message(especially the last line in cmd) then I do a little bit of Googling.just keep ruling out what didn't work eventually you will arrive at d solution.for example,you can startup a new project in a virtual environment n run the server of the new project,if you don't get the error again you can be rest assured the error has to do with the specific project you're working but if you do then the next suspect should probably be your os.since the server is not running at all that rules out the Web browser.

Just be patient,chop it off bit by bit and you will eventually get there.best of luck

On 18 Dec 2020 7:11 pm, "Parul." <parul....@gmail.com> wrote:
I am using the command python manage.py runserver
But it is not running the servers
I tried localhost with 8000 and 8080 also
The tried 0.0.0.0:8000 and with 8080


I am not running any other servers.

While checking the ip4 in cmd...it's showing 192.168.1.11 ....tried python manage.py runserver with this also but didn't work.

On Fri, Dec 18, 2020, 11:27 PM Akanimoh Osutuk <akani...@gmail.com> wrote:
The port is probably being used by another app. Are u running other development servers?

On Fri, 18 Dec 2020, 18:34 Parul., <parul....@gmail.com> wrote:
This is the error which I am getting.

On Fri, Dec 18, 2020, 10:59 PM Akanimoh Osutuk <akani...@gmail.com> wrote:
What errors are you getting?

On Fri, 18 Dec 2020, 17:28 Parul., <parul....@gmail.com> wrote:
i am not able to connect , i tried to use 0.0.0.0:8000 , 0.0.0.0:8080 as well, still getting same error. 
used 127.0.0.1 with ports 8000 and 8080 still getting error 
i have put '*' in ALLOWED_HOSTS

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMcrWSdB_gUw6zeHv9pKXsKpQD4M%3Dqjxh6aaE5HYAsQptrC0DQ%40mail.gmail.com.

Kelvin Sajere

unread,
Dec 20, 2020, 11:34:54 AM12/20/20
to django...@googlegroups.com
If you use a vpn, make sure it’s not on. Some vpn blocks all other ports when they are on.

--
KeLLs

pycode

unread,
Dec 20, 2020, 12:19:06 PM12/20/20
to django...@googlegroups.com
Add views.py with 
from django.http import HttpResponse

def homepage(request):
       return HttpResponse ('hello world')

urls.py

from . import views

urlpatterns = [
       path('/', views.homepage)
]

--

Parul.

unread,
Dec 21, 2020, 2:43:49 AM12/21/20
to django...@googlegroups.com
Hy ,
I added the code but it's still not working

Anirudh Jain

unread,
Dec 21, 2020, 4:32:21 AM12/21/20
to django...@googlegroups.com
Please send picture of your cmd/terminal where you are running the localserver

--

Parul.

unread,
Dec 21, 2020, 7:34:07 AM12/21/20
to django...@googlegroups.com
Hi,

The problem got resolved. I just ran the environment again.... 
And used python manage.py runserver
It worked. Ran on localhost:8000 

May be the port which I was using wasn't free earlier.

Thanks for all the solutions. 

Reply all
Reply to author
Forward
0 new messages