Skip to main content

simplehook / simplehook-django

One line of code. Webhooks just work.

Stop tunneling. Stop polling. Stop building webhook infrastructure. Add one SDK call and your local app receives real webhooks from Stripe, GitHub, Twilio — any provider.

listenToWebhooks(application, os.environ["SIMPLEHOOK_KEY"])

Your app opens an outbound WebSocket to simplehook.dev. When a webhook arrives at your stable URL, it's forwarded through the connection to your local server. Your response goes back to the caller. No CLI. No tunnel process. No URL that changes every session.

Why simplehook?

  • No CLI — just pip install and one function call
  • Permanent URLs — set once in Stripe/GitHub, never change them
  • Real responses — passthrough mode returns your actual response to the caller (TwiML, verification, etc.)
  • Queue + retry — if your app is offline, events queue and deliver when you reconnect
  • Dev mode by default — only connects in development, never in production

Install

pip install simplehook-django

Quick start

# manage.py or wsgi.py
import os
import django
from django.core.wsgi import get_wsgi_application
from simplehook_django import listenToWebhooks

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myproject.settings")
django.setup()

application = get_wsgi_application()

listenToWebhooks(application, os.environ["SIMPLEHOOK_KEY"])
# views.py
from django.http import JsonResponse
from django.views.decorators.csrf import csrf_exempt

@csrf_exempt
def stripe_webhook(request):
    print("Webhook received!", request.body)
    return JsonResponse({"received": True})

Options

listenToWebhooks(application, api_key, {
    "force_enable": False,     # Connect even in production
    "server_url": "...",       # Override server URL
    "on_connect": callback,    # Called when connected
    "on_disconnect": callback, # Called when disconnected
    "silent": False,           # Suppress console output
})

Dev mode

By default, simplehook only connects in development. Set SIMPLEHOOK_ENABLED=false to disable, or force_enable: True to force.

Production is detected when DJANGO_SETTINGS_MODULE is set and DEBUG is False.

Links

License

MIT

Metadata

Release files for simplehook-django 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simplehook-django 0.3.1
File Size Uploaded
simplehook_django-0.3.1.tar.gz 5.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for simplehook-django 0.3.1
File Interpreter ABI Platform
simplehook_django-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.1 kB

Release files / simplehook_django-0.3.1.tar.gz

Download URL simplehook_django-0.3.1.tar.gz
Size 5.7 kB
Tags Source
SHA-256 checksum
How to use checksums
424c6353eb708b30220ca0067b1b49879732d01f10e6a04c11582af6611feb78
BLAKE2b-256 checksum
How to use checksums
348f092f9288cfc08c05197859dd4707fef166ed4c0b423e66098247f7d81368
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / simplehook_django-0.3.1-py3-none-any.whl

Download URL simplehook_django-0.3.1-py3-none-any.whl
Size 5.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5376b2371656e4d4103cc5bd181edcf769cb16476d8da4d5650c60b119f84315
BLAKE2b-256 checksum
How to use checksums
4aefc981399b6a8af1a0c1bca7d1609e43034d7e835d85795d5124b0f3d397fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page