beatonma.org

django-wm: 2.0.0

Published
django-wm
App

Breaking Changes

  • Migrations are now included. If you are upgrading from any 1.x.x version please follow these instructions to avoid data loss. Thanks to @GriceTurrble for providing these instructions.

  • requirements.txt celery version updated to 5.2.2 due to CVE-2021-23727. If you are upgrading from 4.x please follow the upgrade instructions provided by Celery.

Web API changes:

  • /get endpoint:
    • Removed status from JSON object - now uses HTTP response codes 200 if the target url was resolved correctly or 404 otherwise.
    • Missing HCards are now serialized as null instead of an empty dict
// https://example.org/webmention/get?url=my-article
// Old 1.x.x response
{
  "status": 1,
  "target_url": "https://example.org/my-article",
  "mentions": [
    {
      "hcard": {},
      "quote": null,
      "source_url": "https://another-example.org/their-article",
      "published": "2020-01-17T21:45:24.542Z"
    }
  ]
}
// https://example.org/webmention/get?url=my-article
// New 2.0.0 response with HTTP status 200 (or 404 if target_url does not exist)
{
  "target_url": "https://example.org/my-article",
  "mentions": [
    {
      "hcard": null,
      "quote": null,
      "source_url": "https://another-example.org/their-article",
      "published": "2020-01-17T21:45:24.542Z"
    }
  ]
}

New

  • Use{% webmention_endpoint %} template tag to include your Webmentions endpoint in your Django template to help other sites find it easily.

    {% load webmention_endpoint %}
    <!-- my-template.html -->
    ...
    <head>
      <!-- Rendered as <link rel="webmention" href="/webmention/" /> -->
      {% webmention_endpoint %}
    </head>
    ...