Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
114 lines (73 sloc) 3.22 KB


Easily integrate DISQUS comments into your website.

  • Templatetags to ease the integration
  • Export comments from django.contrib.comments & django-threadedcomments to DISQUS
  • Dump DISQUS JSON data into local file


  1. easy_install django-disqus or clone the git repo and run python install.
  2. Add disqus to your INSTALLED_APPS setting.
  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.





Load templatetags with {% load disqus_tags %}.


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 %}
  <meta http-equiv="Content-type" content="text/html; charset=utf-8">
  {% disqus_dev %}


Display comments and comment form.

{% load disqus_tags %}
{% disqus_show_comments %}


  • 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


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 %}


Show recent comments.

{% load disqus_tags %}
{% disqus_recent_comments %}


  • 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

Management Commands


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.


  • -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


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


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


  • --indent: Specifies the indent level to use when pretty-printing output
Something went wrong with that request. Please try again.