Connection Refused Port 8000 Django on Ubuntu 20.04

Posted April 29, 2021 1.5k views
DjangoPython FrameworksUbuntu 20.04

I was following the tutorial at to install Django on a Ubuntu 20.04 Droplet. When I try to access the server ip on port 8000 the server reponds with connection refused and I cannot test the page. I have a feeling it might be where django is binding but I whitelisted the port in UFW. There was another community post here but I am not able to run netstat and I tried to fix the binds by running python3 runserver ipaddress:8000 but still nothing. What am I missing?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

Hi there,

I could suggest checking if Django is binding on so that it could be accessed from the outside world. You can do that with the following command:

netstat -plant | grep 8000

Feel free to share the output here.

If this is not the case, you might have to change the listen address from to