Python · Integration

Add E-Signatures to Django

Send documents for legally binding e-signature from your Django application. One endpoint, no SDK required.

Quick start

  1. Get an API key from signb.ee (free, no credit card)
  2. Set SIGNBEE_API_KEY in your environment
  3. Add the code below to your app

Django example

Python
# views.py
import requests
from django.http import JsonResponse
from django.views.decorators.http import require_POST

@require_POST
def send_contract(request):
    response = requests.post(
        "https://signb.ee/api/send",
        headers={
            "Authorization": f"Bearer {settings.SIGNBEE_API_KEY}",
            "Content-Type": "application/json",
        },
        json={
            "content": request.POST["content"],
            "senderName": request.POST["senderName"],
            "senderEmail": request.POST["senderEmail"],
            "recipientName": request.POST["recipientName"],
            "recipientEmail": request.POST["recipientEmail"],
        },
    )
    return JsonResponse(response.json())

What happens

  1. Your app sends markdown or a PDF URL to Signbee
  2. Signbee generates a PDF (if markdown) and emails the recipient a signing link
  3. Recipient signs — both parties receive the signed PDF with SHA-256 certificate

Also works with AI agents

Install the MCP server to let Claude, Cursor, or Windsurf send documents directly:

npx -y signbee-mcp

Integration details

Django is Python's most popular web framework, used by Instagram, Pinterest, and Mozilla. Adding e-signatures to Django requires just a view function and the requests library — both standard in Django projects.

Django REST Framework: If your Django project uses DRF, replace the function-based view with an APIView or ViewSet. DRF's serializers handle request validation, and its response classes provide consistent JSON formatting. The Signbee API call remains the same.

Settings management: Store SIGNBEE_API_KEY in your Django settings (settings.py) using django-environ or python-decouple for environment variable management. Access it via settings.SIGNBEE_API_KEY in your views. Never hardcode API keys in source files.

CSRF protection: Django's CSRF middleware protects against cross-site request forgery. For API endpoints that receive JSON (not form data), use @csrf_exempt or configure DRF's authentication classes. If your frontend sends the CSRF token, the default protection works fine.

Async support: Django 4.1+ supports async views. Replace requests.post with httpx.AsyncClient for non-blocking API calls in async Django views. This is especially valuable under high concurrency.

Celery integration: For high-volume contract sending, offload the Signbee API call to a Celery task. This returns an immediate response to the user while the contract is generated and sent in the background.

FAQs

How do I add e-signatures to Django?

Get an API key from signb.ee (free, no credit card), set SIGNBEE_API_KEY in your environment, and add a single POST request to your Django application. The recipient receives a signing link by email, signs on any device, and both parties get a SHA-256 certified PDF.

Does Signbee work with Django?

Yes. Signbee is a REST API that works with any language or framework including Django. Send a POST request with your document content, sender and recipient details, and Signbee handles the entire signing ceremony. No SDK required.

Does Signbee work with Django REST Framework?

Yes. Replace the function-based view with a DRF APIView or ViewSet. Use DRF serializers for request validation and response formatting. The Signbee API call (a simple HTTP POST) is identical regardless of whether you use plain Django or DRF.

How do I store the API key in Django?

Use django-environ or python-decouple to load SIGNBEE_API_KEY from environment variables. Add it to your settings.py and access via settings.SIGNBEE_API_KEY. Never hardcode API keys in source files or commit them to version control.

Can I send contracts asynchronously in Django?

Yes. For background processing, use Celery to offload the API call. For async views (Django 4.1+), use httpx.AsyncClient instead of requests for non-blocking API calls under high concurrency.

Related resources

Try Signbee — free, no credit card.