Skip to content

Upgrading

Michael Beaton edited this page Feb 8, 2024 · 6 revisions

Major version releases have breaking changes which may require you to alter your configuration. These changes are described below. See Releases for a complete changelog for each release.

Remember to update your migrations after updating django-wm .

python manage.py makemigrations
python manage.py migrate

4.0

  • MentionableMixin:

    • Removed slug field. If you use this field you can restore the previous behaviour by adding the following to your model.

      # models.py
      
      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.

    • allow_outgoing_webmentions default now configurable via settings.WEBMENTIONS_ALLOW_OUTGOING_DEFAULT. This change requires you to run makemigrations to update your existing models.

  • 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/.

3.0

  • Unused MentionableMixin.allow_incoming_webmentions field has been removed.
  • Any existing instances of PendingIncomingWebmention and PendingOutgoingContent will 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.

2.0

Version 1.x did not include migration files which unfortunately makes upgrading from it a little tricky. If you are using any 1.x.y version of this library, please follow this guide to upgrade without losing any webmention data.