Set up long polling Publisher
This document describes how to set up a publisher using the long polling technique.
Configure WAGTAIL_LIVE_PUBLISHER
In order to use the long polling technique for the publishing part, add this to your settings
:
WAGTAIL_LIVE_PUBLISHER = "wagtail_live.publishers.polling.LongPollingPublisher"
You can optionally set a polling timeout:
WAGTAIL_LIVE_POLLING_TIMEOUT = value # in seconds
Add publisher template
We also need to add this to our live_blog_page.html
template:
{% include "wagtail_live/polling/long_polling.html" %}
Make sure you have these 2 lines in your template:
{% include "wagtail_live/live_posts.html" %}
{% include "wagtail_live/polling/long_polling.html" %}
Add URLs
Add the Wagtail Live URLs to your urls.py
:
from django.urls import include, path
from wagtail_live import urls as live_urls
urlpatterns += [
path('wagtail_live/', include(live_urls)),
]