django-wm: 3.0.0
Upgrade warning
If upgrading from an older version please be aware of these changes:
- Unused
MentionableMixin.allow_incoming_webmentionsfield has been removed. - Any existing instances of
PendingIncomingWebmentionandPendingOutgoingContentwill be deleted.- These models have new constraints so it is necessary to recreate them.
- If this is problematic for you please don’t upgrade yet. Contact me or create an issue and I will make a tool to persist these between versions.
Changes
Thanks to @philgyford for reporting most of the issues referenced here.
Resolves #25.
Added
QuotableMixin.post_typefield.Incoming webmentions are now checked for the following microformat properties that describe the type of mention they are:
u-bookmark-ofu-like-ofu-listen-ofu-in-reply-tou-repost-ofu-translation-ofu-watch-of
The
/webmention/getendpoint serializes these values in thetypefield respectively as:bookmarklikelistenreplyreposttranslationwatch- If no specific
typeis specified this defaults towebmention.
Resolves #30
- Added
MentionableMixin.should_process_webmentions() -> boolmethod to enable custom logic.
- Added
Resolves #31
- Success message now rendered via template, enabling override by user.
Resolves #32
- Same-page
#anchorlinks no longer treated as webmention targets.
- Same-page
-
- Much improved parsing of
h-card.- Now tries to find an
h-cardthat is directly related to the mention link (embedded inp-authorof a parenth-entryorh-feedcontainer). - If that doesn’t yield a result, try to find a top-level
h-cardon the page.
- Now tries to find an
- Removed
HCard.from_soup()classmethod. Parsing logic moved totasks.incoming.parsingpackage.
- Much improved parsing of
Resolves #36
- Added constraints to
PendingIncomingWebmentionandPendingOutgoingContentto avoid duplication.- Warning: If updating from an older version of
django-wmthis will delete any existingPending...model instances.
- Warning: If updating from an older version of
- Request timeouts are now handled gracefully.
PendingIncomingWebmentionandOutgoingWebmentionStatusnow implement the newRetryableMixin.- Reworked webmention processing tasks to allow failed webmentions to be retried periodically.
- See settings
WEBMENTIONS_MAX_RETRIES,WEBMENTIONS_RETRY_INTERVAL,WEBMENTIONS_TIMEOUTbelow for customisation details.
- See settings
- Added constraints to
New
dashboard/view: a simple overview of recent mentions.- Shows the latest instances of
Webmention,OutgoingWebmentionStatus,PendingIncomingWebmention,PendingOutgoingContentand info on their current status. - By default, restricted to users with
mentions.view_webmention_dashboardpermission. - Can be made public via
settings.WEBMENTIONS_DASHBOARD_PUBLIC = True.
- Shows the latest instances of
New optional settings:
settings.WEBMENTIONS_TIMEOUT[float| default=10] specifies the time (in seconds) to wait for network calls to resolve.settings.WEBMENTIONS_RETRY_INTERVAL[int| default=600] specifies the minimum time (in seconds) to wait before retrying to process a webmention.settings.WEBMENTIONS_MAX_RETRIES[int| default=5] specifies how many times we can attempt to process a mention before giving up.settings.WEBMENTIONS_DASHBOARD_PUBLIC[bool| default=False] specifies whether the thedashboard/view can be viewed by anyone. IfFalse(default), thedashboard/view is only available to users withmentions.view_webmention_dashboardpermission.
WebmentionHeadMiddleware- Removed port from generated endpoint URL in HTTP headers as
request.META.SERVER_PORTmay not be reliable depending on reverse proxy configuration.
- Removed port from generated endpoint URL in HTTP headers as
MentionableMixin:mentions()is now a method, not a property.- Removed field
allow_incoming_webmentionsas it has never been used for anything.
Streamlined template tags
{% load webmentions_endpoint %}replaced by{% load webmentions %}.{% webmention_endpoint %}replaced by{% webmentions_endpoint %}(used in HTML<head>).- New tag
{% webmentions_dashboard %}creates a<a>link</a>to yourwebmentions/dashboard/view.