Django-wm

Latest version: v4.1.1

Safety actively analyzes 623412 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

4.1.1

> [!WARNING]
> `python manage.py migrate` required for new fields.

- Added `Webmention.has_been_read: bool` field.
- New context processor `mentions.context_processors.unread_webmentions` adds `unread_webmentions` field to template context, containing the queryset of unread Webmention objects.
- Added admin actions for marking as read/unread.

- New `objects` manager for Webmention with some common filters and actions.

- New settings for allowing or disabling webmentions to/from a set of domains:
- <a href="SettingsWEBMENTIONS_DOMAINS_INCOMING_ALLOW">`WEBMENTIONS_DOMAINS_INCOMING_ALLOW: Iterable[str] = None`</a>
- <a href="SettingsWEBMENTIONS_DOMAINS_INCOMING_DENY">`WEBMENTIONS_\DOMAINS_INCOMING_DENY: Iterable[str] = None`</a>
- <a href="SettingsWEBMENTIONS_DOMAINS_OUTGOING_ALLOW">`WEBMENTIONS_DOMAINS_OUTGOING_ALLOW: Iterable[str] = None`</a>
- <a href="SettingsWEBMENTIONS_DOMAINS_OUTGOING_DENY">`WEBMENTIONS_DOMAINS_OUTGOING_DENY: Iterable[str] = None`</a>

- New settings for tags that can be added to your HTML links to allow/disable sending webmentions for just that specific link. (Overrides above allow/deny lists)
- <a href="SettingsWEBMENTIONS_DOMAINS_OUTGOING_TAG_ALLOW">`WEBMENTIONS_DOMAINS_OUTGOING_TAG_ALLOW: str = None`</a>
- <a href="SettingsWEBMENTIONS_DOMAINS_OUTGOING_TAG_DENY">`WEBMENTIONS_DOMAINS_OUTGOING_TAG_DENY: str = None`</a>

4.0.4

- Resolves [53](https://github.com/beatonma/django-wm/issues/53): Compatibility with dependency `mf2py>=2.0`.

4.0.2

- Resolves [50](https://github.com/beatonma/django-wm/issues/50): broken search field on QuotableAdmin.
- Added tests for admin pages to avoid that sort of thing happening again.
- Minor touch-ups for the admin pages.
- Source and target URL fields are now read-only.
- Added appropriate search fields and list filters for each model.
- `quote` field now uses a textarea widget for comfier editing.

4.0.1

- Added management command `mentions_reverify [filters ...] [--all]`
- Allows you to reprocess received Webmentions to see if they are still 'live'.
- Accepts a space-separated list of `field=value` queryset filters, or `--all` to reprocess all of them.

- Added management command `mentions_pending` to replace `pending_mentions` for naming consistency with other commands.
- `pending_mentions` still works though.

- Now compatible with `Wagtail>=3.0.3` (previously `>=4.0`).
- `mentions_wagtail_path` still requires `>=4.0`: use `mentions_wagtail_route` or `mentions_wagtail_re_path`.

4.0.0

> This update alters fields on `MentionableMixin` so you will need to run `makemigrations` and `migrate` after upgrading!

- `MentionableMixin`:
- `allow_outgoing_webmentions` default now configurable via `settings.WEBMENTIONS_ALLOW_OUTGOING_DEFAULT`.
- Removed `slug` field. If you use this field you can restore the previous behaviour by adding the following to your model.

python
class MyModel(MentionableMixin, models.Model):
slug = models.SlugField(unique=True)

classmethod
def resolve_from_url_kwargs(cls, slug, **url_kwargs):
return cls.objects.get(slug=slug)

- Deprecated method`all_text`, replaced by `get_content_html`. Overriding `all_text` still works for now but will log a warning asking you to rename the method.


- Moved template files to `mentions` sub-directory. If you have custom overrides of these templates in your root `templates/` directory please move them to `templates/mentions/`.


- Added user agent header to all network requests.
- Customisable via `settings.WEBMENTIONS_USER_AGENT: str`.


- Admin-facing strings are now translatable.


- Added `urlpatterns` helper functions `mentions_path`, `mentions_re_path` for (hopefully) simpler setup.
- More straightforward view-to-model mapping.
- Removes the need to implement `resolve_from_url_kwargs` on your MentionableMixin implementation.
- See [the wiki](https://github.com/beatonma/django-wm/wiki/Guide_Using-MentionableMixin#urlpatterns) for example setup instructions.


- Support for [Wagtail](https://wagtail.org/).
- `Page` models should implement `MentionableMixin` as usual.
- `RoutablePageMixin` should use the new `mentions_wagtail_path`, `mentions_wagtail_re_path` decorators in place of the Wagtail equivalents `path`, `re_path`.
- These work essentially the same `mentions_path` and `mentions_re_path`.
- If using RichTextField call `richtext` on any RichTextField values in `get_content_html`:
python
from wagtail.templatetags.wagtailcore_tags import richtext

class MyModel(MentionableMixin, Page):
...
def get_content_html(self) -> str:
return f"{richtext(self.overview)} {richtext(self.body)}"



- Wiki pages are now [live](https://github.com/beatonma/django-wm/wiki/)! These will be kept up-to-date going forwards but may not be useful for pre-4.0 versions.


- Fix: Relative URLs in `h-card` homepage or avatar are now resolved to absolute URLs.

3.1.1

Fixes [43](https://github.com/beatonma/django-wm/issues/43): outgoing webmention being resubmitted continuously.

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.