Extension Disqus Commenting


Extension Basics

Title
Disqus Commenting
Name
ckanext-disqus
Type
Public extension
Description
AJAX-based commenting system for CKAN datasets using Disqus platform with Single Sign On support
CKAN versions

~2.9, ~2.10, ~2.11

Show details
Download-Url (zip)
Download-Url commit date
2025-10-10
Url to repo
Category
Content Management


Background Infos

Description (long)
Show details

Adds AJAX-based commenting functionality to CKAN package pages using the Disqus commenting platform. Provides seamless integration with Disqus forums, supports Single Sign On (SSO) for automatic user authentication, and includes a recent comments widget. Requires setting up a Disqus forum account. Compatible with CKAN 1.7 and higher. Features include: automatic disqus_identifier generation using {controller}::{id} pattern, template helpers for embedding comments and recent comment widgets, configurable comment count in recent widget, full SSO integration with Disqus API keys for automatic user authentication.

Version
0.1
Version release date
2025-10-10
Contact name
Open Knowledge Foundation
Contakt email
Contact Url
(not set)


Installation Guide

Configuration hints

Requirements: - CKAN 1.7+ - Disqus account and forum - Disqus API keys (for Single Sign On support)

Installation: 1. Activate CKAN virtualenv: . /usr/lib/ckan/default/bin/activate

  1. Install extension: pip install -e git+https://github.com/okfn/ckanext-disqus#egg=ckanext-disqus

  2. Add plugin to ckan.plugins: ckan.plugins = … disqus …

  3. Configure Disqus settings (see Configuration below)

  4. Restart CKAN: sudo service apache2 restart

Disqus Account Setup: 1. Create Disqus account at https://disqus.com/ 2. Register your site to get a forum shortname 3. (Optional) Generate API keys for SSO: - Go to https://disqus.com/api/applications/ - Create new application - Note the Public Key and Secret Key

Configuration:

Required Settings:

Disqus forum shortname (from your Disqus account)

disqus.name = your-forum-shortname

Optional Settings:

Full URL to Disqus site (for better integration)

disqus.disqus_url = http://your-site.disqus.com

Single Sign On API keys (for automatic user authentication)

disqus.secret_key = YOUR_DISQUS_SECRET_KEY disqus.public_key = YOUR_DISQUS_PUBLIC_KEY

Usage:

Automatic Integration: - Comments automatically appear on package pages after installation - Uses disqus_identifier format: {controller}::{id} Example: package::my-dataset-name

Template Helpers:

  1. Add comments to custom template: {{ h.disqus_comments() }}

    This embeds the full Disqus comment thread for the current page.

  2. Add recent comments widget: {{ h.disqus_recent() }}

    Shows recent comments across all threads.

  3. Customize recent comments count: {{ h.disqus_recent(num_comments=10) }}

    Default is 5 comments if not specified.

Single Sign On (SSO):

When SSO is configured with API keys: - Users automatically authenticated with their CKAN credentials - No separate Disqus login required - User display name matches CKAN username - Seamless commenting experience

To enable SSO: 1. Obtain Disqus API keys (see Disqus Account Setup above) 2. Add keys to production.ini: disqus.secret_key = YOUR_SECRET_KEY disqus.public_key = YOUR_PUBLIC_KEY 3. Restart CKAN

Customization:

Customize Disqus Identifier: By default, identifiers use pattern: {controller}::{id}

To customize, override in your theme: - Modify the disqus_identifier in template context - Ensure identifiers remain consistent for each page

Customize Appearance: Disqus appearance configured through Disqus admin panel: 1. Log into https://disqus.com/admin/ 2. Select your forum 3. Go to Settings → Appearance 4. Customize colors, layout, etc.

Moderation:

Moderate comments through Disqus: 1. Log into https://disqus.com/admin/ 2. Select your forum 3. Go to Moderate 4. Approve, delete, or mark as spam

Moderation settings: - Pre-moderation (approve before publishing) - Automatic spam detection - User blocking - Comment filtering

Troubleshooting:

  1. Comments not appearing:

    • Verify disqus.name is set correctly in production.ini
    • Check Disqus forum is active
    • Ensure JavaScript is enabled in browser
    • Check browser console for errors
  2. SSO not working:

    • Verify disqus.secret_key and disqus.public_key are correct
    • Check Disqus application is approved for SSO
    • Verify user is logged into CKAN
    • Check CKAN logs for authentication errors
  3. Widget not showing recent comments:

    • Verify there are existing comments
    • Check disqus.name matches forum shortname
    • Ensure widget JavaScript loads correctly
  4. Wrong site comments appearing:

    • Verify disqus_identifier is unique per page
    • Check disqus.name matches intended forum
    • Review Disqus forum settings

Development:

The extension provides: - Plugin class: ckanext.disqus.plugin:Disqus - Template helpers for embedding Disqus components - SSO payload generation and signing - Automatic identifier generation

License: GPL

Keywords: CKAN, comments, disqus, discussion, sso

Developer: Open Knowledge Foundation

Plugins to configure (ckan.ini)
# disqus=ckanext.disqus.plugin:Disqus
CKAN Settings (ckan.ini)
# disqus.name = your-forum-shortname # disqus.secret_key = YOUR_DISQUS_SECRET_KEY # disqus.public_key = YOUR_DISQUS_PUBLIC_KEY
DB migration to be executed
(not set)
<< back to Extensions