webmention for Django projects.
This package provides a way to integrate webmention endpoint discovery and webmention receipts into your project. Once you follow the installation instructions, you should be able to use something like webmention.rocks to generate a test webmention and see it in the Django admin panel.
Once you receive a webmention, you can click through to the page the webmention was sent from and see what people are saying about your site. Afterward, you can mark the webmention as reviewed in the Django admin so you can more easily see the latest webmentions you receive.
Once you verify that you're receiving webmentions successfully, you can use the webmention information as you like. As an example, you could query the webmentions that are responses to a specific page and display them on that page.
This package does not currently provide functionality for sending webmentions.
$ pip install django-webmention
- Add
'webmention'
toINSTALLED_APPS
- Run
python manage.py migrate webmention
- Add the URL patterns to your top-level
urls.py
path('webmention/', include('webmention.urls'))
for Django >= 3.2
- Include webmention information by either:
- Installing the middleware in
settings.py
(affects all views)- Append
webmention.middleware.webmention_middleware
to yourMIDDLEWARE
settings
- Append
- Decorating a specific view with
webmention.middleware.include_webmention_information
- Installing the middleware in
- View webmention responses in the Django admin interface and mark them as reviewed as needed
- Install tox
You can run tests using tox
:
$ tox --parallel=auto