Skip to main content
https://img.shields.io/readthedocs/django-indieweb?style=for-the-badge https://img.shields.io/pypi/v/django-indieweb.svg?style=for-the-badge prek

A Django application that provides IndieAuth, Micropub, Webmention, and WebSub support for IndieWeb integration

Documentation

The full documentation is at https://django-indieweb.readthedocs.io/.

Features

  • IndieAuth authentication endpoint

  • IndieAuth token endpoint

  • Micropub endpoint with content creation, source query, update, delete, undelete, and media upload support

  • Webmention sending and receiving

  • WebSub publisher helpers for topic discovery links and hub notifications

  • Minimal WebSub subscriber callback support with lease tracking and delivery hooks

  • Pluggable content handler system for Micropub

  • Pluggable interfaces for Webmention URL resolution and spam checking

  • Support for both form-encoded and JSON Micropub requests

  • Microformats2 parsing for rich webmention content

  • Micropub query endpoints (config with media-endpoint discovery, syndicate-to, source)

  • Django integration

Installation

Install django-indieweb using pip:

pip install django-indieweb

Or with uv:

uv pip install django-indieweb

Quick Start

  1. Add “indieweb” to your INSTALLED_APPS setting:

    INSTALLED_APPS = [
        ...
        'indieweb',
    ]
  2. Include the indieweb URLconf in your project urls.py:

    path('indieweb/', include('indieweb.urls')),
  3. Run migrations:

    python manage.py migrate
  4. Visit the IndieWeb endpoints at:

    • /indieweb/auth/ - Authentication endpoint

    • /indieweb/token/ - Token endpoint

    • /indieweb/micropub/ - Micropub endpoint

    • /indieweb/media/ - Micropub media endpoint

    • /indieweb/webmention/ - Webmention endpoint

  5. To use Micropub for content creation and editing, create a custom content handler:

    from indieweb.handlers import MicropubContentHandler, MicropubEntry
    
    class MyContentHandler(MicropubContentHandler):
        def create_entry(self, properties, user):
            # Create your content here
            post = MyBlogPost.objects.create(
                author=user,
                content=properties.get('content', [''])[0]
            )
            return MicropubEntry(
                url=post.get_absolute_url(),
                properties=properties
            )
        # ... implement other methods

    Then configure it in settings:

    INDIEWEB_MICROPUB_HANDLER = 'myapp.handlers.MyContentHandler'

Production Deployment

The bundled defaults favour protocol compatibility (PKCE optional, me not bound to the logged-in user, rate limits disabled). For an internet-facing IndieAuth/Micropub deployment, see the Production hardening section of the configuration guide for a copyable settings snippet: https://django-indieweb.readthedocs.io/en/latest/configuration.html#production-hardening

Adapter Responsibilities

Micropub handlers are host-owned authorization boundaries. After django-indieweb authenticates the bearer token and checks the requested scope, your MicropubContentHandler must verify that the authenticated user is allowed to create, update, delete, undelete, read source content, list content or media, and manage media for the submitted URL or storage object. The bundled InMemoryMicropubHandler is an unsafe development/testing example only; it keeps entries in process memory and performs no ownership checks.

Development

Setting up development environment:

git clone https://github.com/ephes/django-indieweb.git
cd django-indieweb
uv sync

Handy Just commands (install just first)

just install      # sync dependencies via uv
just test         # run the pytest suite
just typecheck    # run mypy
just test-one path/to/test.py::TestCase::test_method

Running Tests

Run the test suite with coverage and the configured coverage gate:

uv run pytest

Generate an HTML coverage report:

uv run pytest --cov-report=html
open htmlcov/index.html

Run tests for the supported Python/Django matrix using tox:

tox

The supported tox matrix covers Django 5.2 LTS on Python 3.10 through 3.14 and Django 6.0 and 6.1 on Python 3.12 through 3.14.

Run tests once with Django migrations enabled using tox:

tox -e py313-django52-migrations

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

BSD License

Release files for django-indieweb 0.6.2

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

Source distribution (sdist)

Source distribution for django-indieweb 0.6.2
File Size Uploaded
django_indieweb-0.6.2.tar.gz 115.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-indieweb 0.6.2
File Interpreter ABI Platform
django_indieweb-0.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 260.3 kB

Release files / django_indieweb-0.6.2.tar.gz

Download URL django_indieweb-0.6.2.tar.gz
Size 115.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e6c90343cc5ffac14c81738867363b5f9070ca65554ed3870ed68272b27b1907
BLAKE2b-256 checksum
How to use checksums
153f828eda8ebf4c75a7981451363d8e8d3d3353603fcaa4753cc61d036d93d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / django_indieweb-0.6.2-py3-none-any.whl

Download URL django_indieweb-0.6.2-py3-none-any.whl
Size 145.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5a810a9188a66d5d9f9b9d274157c16c87beaad3e4da65c7ace96f4598c245e
BLAKE2b-256 checksum
How to use checksums
b4353179a5c948f675db1acb9ae33e0206ac2e2819ff9081b4e668d44d742c6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.6.2 This release

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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