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.
What Uses Port 8000?
| Tool | Command |
|---|---|
| Django | python manage.py runserver |
| Python HTTP Server | python -m http.server |
| Gatsby | gatsby develop |
| PHP built-in | php -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
| Problem | Solution |
|---|---|
| Port already in use | runserver 8001 |
| DisallowedHost error | Add host to ALLOWED_HOSTS in settings.py |
| Static files 404 | Run collectstatic, check STATIC_URL |
| Can't access from network | Use 0.0.0.0:8000 instead of localhost |