github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

arthurk / django-disqus

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 72
    • 7
  • Source
  • Commits
  • Network (7)
  • Issues (1)
  • Downloads (2)
  • Wiki (1)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (2)
    • 0.2
    • 0.1
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Easily integrate DISQUS comments into your Django website — Read more

  cancel

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

work on importing Threads and Posts 
arthurk (author)
Sun Dec 13 12:34:28 -0800 2009
commit  6519e927282ce231a351946c882a6f0964ce4584
tree    b892e7ee459c114bf8f1c9e1e22094b9322dcbf3
parent  37ed39d96376edcfcd767b6a778a7a7093bd3b3d
django-disqus /
name age
history
message
file .gitignore Tue Dec 01 12:40:13 -0800 2009 resolve conflicts [arthurk]
file LICENSE Tue Jan 20 13:07:21 -0800 2009 first commit [arthurk]
file README.markdown Tue Dec 01 12:46:50 -0800 2009 minor README changes [arthurk]
directory disqus/ Sun Dec 13 12:34:28 -0800 2009 work on importing Threads and Posts [arthurk]
file setup.py Thu Aug 20 08:24:00 -0700 2009 remove new api for now, as it wasnt being used ... [arthurk]
README.markdown

django-disqus

Easily integrate DISQUS comments into your website.

  • Templatetags
  • Export comments from django.contrib.comments and django-threadedcomments
  • Dump DISQUS JSON data into local file

django-disqus is available open-source under the BSD license.

Installation

  1. pip install django-disqus or clone the repo and run python setup.py install
  2. Add disqus to your INSTALLED_APPS
  3. Add DISQUS_API_KEY and DISQUS_WEBSITE_SHORTNAME to your settings. You can get your API key here. The shortname of your site can be found in the right sidebar ("My Websites") on the DISQUS homepage.

Example settings.py:

INSTALLED_APPS = (
    ...
    'django.contrib.comments',
    'disqus',
)

DISQUS_API_KEY = 'FOOBARFOOBARFOOBARFOOBARFOOBARF'
DISQUS_WEBSITE_SHORTNAME = 'foobar'

Templatetags

Load the templatetags with {% load disqus_tags %}.

disqus_dev

Disables url validation and sets the page URL associated with a comment thread to the current Site's domain if DEBUG = True.

This is neccesary to get comments working on a local development server.

{% load disqus_tags %}
<head>
  <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  <title>fooar</title>
  {% disqus_dev %}
</head>

disqus_show_comments

Display comments and comment form.

{% load disqus_tags %}
{% disqus_show_comments %}

Options

  • title: Defines the comment thread's title.
  • url: Defines the page URL associated with a comment thread. Disqus uses this URL to uniquely create and identity a comment thread.
  • snippet: Defines the page's content (article or blog post) to use as context.
  • shortname: Use a different shortname than settings.DISQUS_WEBSITE_SHORTNAME

disqus_num_replies

Replace all URLs that have the #disqus_thread anchor with their respective comment count.

{% load disqus_tags %}
<a href="{{ object.get_absolute_url }}#disqus_thread">View Comments</a>
{% disqus_num_replies %}

disqus_recent_comments

Show recent comments.

{% load disqus_tags %}
{% disqus_recent_comments %}

Options

  • num_items: Number of comments to show (default: 3)
  • avatar_size: Size of the avatars (default: 32)
  • shortname: Use a different shortname than settings.DISQUS_WEBSITE_SHORTNAME

disqus_top_commenters

Shows top commenters.

{% load disqus_tags %}
{% disqus_top_commenters %}
Options
  • num_items: Number of comments to show (default: 3)
  • avatar_size: Size of the avatars (default: 32)
  • shortname: Use a different shortname than settings.DISQUS_WEBSITE_SHORTNAME
  • hide_mod: Set to 1 to hide moderators
  • hide_avatars: Set to 1 to hide avatars

disqus_popular_threads

Shows most popular threads.

{% load disqus_tags %}
{% disqus_popular_threads %}

Options

  • num_items: Number of comments to show (default: 3)
  • shortname: Use a different shortname than settings.DISQUS_WEBSITE_SHORTNAME

Management Commands

disqus-export

Exports comments from django.contrib.comments to DISQUS.

When exporting comments, make sure you have the domain of your Site set. Also the Model to which the comments are associated needs a get_absolute_url() method which returns the absolute url to the page the comments should appear on.

Threaded comments are not supported.

Options

  • -d/--dry-run: Does not export any comments, but merely outputs the comments which would have been exported
  • -v/--verbosity: Output verbosity level; 0=minimal output, 1=normal output

disqus-threadedcomments-export

Same as disqus-export but exports comments from disqus-threadedcomments.

disqus-dumpdata

The disqus-dumpdata command dumps DISQUS comments into a local JSON file.

Options

  • --indent: Specifies the indent level to use when pretty-printing output
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server