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
Add “indieweb” to your INSTALLED_APPS setting:
INSTALLED_APPS = [ ... 'indieweb', ]Include the indieweb URLconf in your project urls.py:
path('indieweb/', include('indieweb.urls')),Run migrations:
python manage.py migrate
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
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 methodsThen 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)
| File | Size | Uploaded | |
|---|---|---|---|
| django_indieweb-0.6.2.tar.gz | 115.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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}
|