Django UDP Discovery
ProductionOgro Projukti · Open Source Libraries
Let clients find your Django server on the LAN — no hardcoded IPs.
- GitHub stars
- 4
- License
- MIT
pip install django-udp-discovery>About Django UDP Discovery
django-udp-discovery adds UDP-based service discovery to any Django project. When Django starts, a background thread listens on a UDP port; clients on the same network broadcast a discovery message and receive the server's IP address in reply.
It is built for intranet deployments where DNS is unavailable or unreliable — classrooms, offices and field sites — and pairs with Django UDP Discovery Client.
- Version
- 1.0.0
- Updated
- 28 Nov 2025
- Available for
- Windows, Linux
- Languages
- Python
- Price
- Free
- License
- MIT
>Key features
Automatic discovery
Django servers answer UDP discovery requests as soon as the app loads.
Zero configuration
Works out of the box with sensible defaults; every setting is overridable.
Thread-safe
A background daemon thread that never blocks Django.
Production ready
Thorough error handling, port-conflict recovery and graceful shutdown.
Management command
Start the service on demand, optionally for a fixed duration.
Well tested
Full test coverage with isolated test cases.
>How it works
- 01
Listen
When Django starts, a background thread listens on UDP port 9999.
- 02
Broadcast
A client broadcasts the DISCOVER_SERVER message on the local network.
- 03
Respond
The server validates the message and replies with SERVER_IP:<address>.
- 04
Connect
The client connects to the address it received — no hardcoded IPs.
>Get started
Requirements
- Python 3.7+
- Django 2.2+
- Windows or Linux (macOS is not supported yet)
pip install django-udp-discoveryINSTALLED_APPS = [ # ... "django_udp_discovery",]python manage.py start_discovery --duration 60DISCOVERY_PORT = 9999DISCOVERY_MESSAGE = "DISCOVER_SERVER"RESPONSE_PREFIX = "SERVER_IP:"DISCOVERY_TIMEOUT = 0.5>Changelog
v1.0.0
- First stable release on PyPI
>Ratings & reviews
—
0 reviews
- 5 ★0% (0)
- 4 ★0% (0)
- 3 ★0% (0)
- 2 ★0% (0)
- 1 ★0% (0)