django-grip
Django GRIP library
What it is and what it does
Django GRIP is middleware that bridges Django applications with external GRIP-compatible proxies like Pushpin or Fastly Fanout. Instead of holding connections in your Django process, the middleware delegates long-lived HTTP and WebSocket connections to a specialized proxy, freeing your application to handle requests more efficiently. The proxy manages the actual connection lifetime while your Django views respond quickly and let the middleware handle the protocol translation.
You configure it by adding GripMiddleware to your Django settings and pointing it at your GRIP proxy via GRIP_URL. Your views then use helper functions to subscribe clients to channels or broadcast updates. The middleware handles parsing GRIP headers, converting WebSocket-Over-HTTP events, and managing subscriptions—your code sees a simplified interface while the proxy handles the heavy lifting of keeping connections alive.
Use it for:
- Build HTTP streaming endpoints that push data to many clients without blocking Django worker processes
- Implement long-polling endpoints that hold client requests until data changes, then deliver updates efficiently
- Create WebSocket-like bidirectional communication in Django without running a separate WebSocket server
- Scale real-time features across multiple Django instances by offloading connection management to a proxy layer
- Reduce memory and CPU overhead by delegating connection hold-time to a specialized proxy
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Integrates Django with GRIP-compatible proxies (Pushpin, Fastly Fanout) to delegate long-lived HTTP and WebSocket connection management away from the application.
Yes, if you have a GRIP proxy (Pushpin or Fastly Fanout) already deployed and need to add real-time features to Django. The middleware is straightforward to integrate and offloads connection management cleanly. No, if you lack the proxy infrastructure or prefer a self-contained solution—the external dependency is non-negotiable. The aging release cycle (508 days since last update) is acceptable for stable middleware but warrants checking compatibility with your Django version before committing.
Install
django-grip on PyPI
pip
pip install django-gripuv
uv add django-grippoetry
poetry add django-gripInstalling django-grip
Before you install
High install friction; no runtime dependencies but requires external GRIP proxy infrastructure (Pushpin or Fastly Fanout) to function. Package is aging (last release 508 days old) but repository is active and not archived.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute this package freely provided you include the license notice.
Quickstart
pip install django-grip
# In settings.py:
MIDDLEWARE = ['django_grip.GripMiddleware', ...]
GRIP_URL = 'http://localhost:5561'
# In views.py:
from django_grip import set_hold_stream, publish
def myendpoint(request):
if not request.grip_proxied:
return HttpResponse('Not Implemented', status=501)
resp = HttpResponse('[stream open]\n')
set_hold_stream(request, 'test')
return resp
Requires a running GRIP proxy (Pushpin or Fastly Fanout) configured and accessible at the GRIP_URL; Django app will not handle long-lived connections without it.
Verify before relying
- Minimum Python version and Django version compatibility (requires_python is unspecified in metadata)
- Whether the package works with current Django LTS versions
- Performance characteristics and scalability limits for high-concurrency scenarios
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | aging — 508 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 78,183/month — #14,463 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django-grip-3.5.2.tar.gz
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
gripcontrolImplements the GRIP (Generic Real-time…
permissive · top 15,000 on PyPI
django-eventstreamAdds Server-Sent Events (SSE) streaming to…
permissive · top 15,000 on PyPI
gripGrip is a command-line server that renders…
permissive · top 15,000 on PyPI
websockets-proxyEnables WebSocket connections through HTTP and…
permissive · top 15,000 on PyPI
bottle-websocketAdds WebSocket support to the Bottle web…
permissive · top 15,000 on PyPI
channelsChannels augments Django with WebSocket,…
permissive · top 5,000 on PyPI
jupyter-http-over-wsAdds a WebSocket-based HTTP proxy endpoint to…
permissive · top 15,000 on PyPI
daphneDaphne is an ASGI server that handles HTTP,…
permissive · top 5,000 on PyPI
django-cors-headersAdds Cross-Origin Resource Sharing (CORS)…
permissive · top 1,000 on PyPI
pyopImplements an OpenID Connect Provider (OP)…
permissive · top 15,000 on PyPI