localhost:8000

Python developers know this port well. Django runs here by default, and Python's built-in HTTP server (python -m http.server) uses 8000 too. Quick way to serve files or run a Django project.

Open localhost:8000

What Uses Port 8000?

ToolCommand
Djangopython manage.py runserver
Python HTTP Serverpython -m http.server
Gatsbygatsby develop
PHP built-inphp -S localhost:8000

Django Quick Start

# Create Django project
django-admin startproject mysite
cd mysite

# Run development server
python manage.py runserver

# Output:
# Starting development server at http://127.0.0.1:8000/

Python HTTP Server

Quickest way to serve static files:

# Python 3
python -m http.server 8000

# Serves current directory at http://localhost:8000

Change Django Port

# Specify port
python manage.py runserver 3000

# Specify IP and port
python manage.py runserver 0.0.0.0:8000

Common Issues

ProblemSolution
Port already in userunserver 8001
DisallowedHost errorAdd host to ALLOWED_HOSTS in settings.py
Static files 404Run collectstatic, check STATIC_URL
Can't access from networkUse 0.0.0.0:8000 instead of localhost

Related Ports

PortCommon Use
5000Flask
8080Tomcat, Java
3000Node.js