Skip to content

Set up PieSocket publisher


Note

PieSocket offers a 'free-plus' plan to Wagtail-live users. This is the same as the free plan, but with an increased limit of 1 million messages per day. To benefit from this offer, follow the partner link instead of the regular one.


This document describes how to set up a publisher using PieSocket(partner link) websocket server API.

Create a PieSocket account

First, you will need to create a PieSocket account here(partner link).

Create a new API key

Once you have created an account, you will need to create a new API KEY. In your dashboard, fill in the key name field and click the CREATE NEW KEY button.

PieSocket dashboard screenshot

Retrieve your API key, your secret and PieSocket endpoint

Wagtail Live needs your API_KEY and your SECRET. It also needs the API endpoint to use. After creating a new key, you can click the little information icon to find them as shown below:

PieSocket credentials

Add your credentials and PieSocket endpoint to settings

The PieSocket endpoint depends on the cluster. In the above image the PieSocket endpoint is: us-nyc-1.piesocket.com/v3/.

Add the following in your settings.base file:

PIESOCKET_API_KEY = "your-api-key"
PIESOCKET_SECRET = "your-secret"
PIESOCKET_ENDPOINT = "your-piesocket-endpoint"

Configure WAGTAIL_LIVE_PUBLISHER

In order to use PieSocket for the publishing part, add this to your settings:

WAGTAIL_LIVE_PUBLISHER = "wagtail_live.publishers.piesocket.PieSocketPublisher"

Add publisher template

We also need to add this to our live_blog_page.html template:

{% include "wagtail_live/websocket/piesocket.html" %}