Every repository with this icon (
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Mon Feb 02 03:18:43 -0800 2009 | |
| |
LICENSE | Tue Jan 20 13:07:21 -0800 2009 | |
| |
README.markdown | Thu Aug 20 06:54:57 -0700 2009 | |
| |
disqus/ | Thu Aug 20 08:24:00 -0700 2009 | |
| |
setup.py | Thu Aug 20 08:24:00 -0700 2009 |
django-disqus
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
Installation
easy_install django-disqusor clone the git repo and runpython setup.py install.- Add
disqusto yourINSTALLED_APPSsetting. - Add
DISQUS_API_KEYandDISQUS_WEBSITE_SHORTNAMEto 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 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 thansettings.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 thansettings.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







