Django-comments-xtd comes with three demo projects:
You may want to have a look at the example sites dir in the repository.
The recommended way to run the demo sites is in its own virtualenv. Once in a new virtualenv, clone the code and cd into any of the 3 demo sites. Then run the install script and launch the dev server:
$ git clone git://github.com/danirus/django-comments-xtd.git
$ cd django-comments-xtd/django_comments_xtd/demos/[simple|simple_thread|multiple]
$ sh ./install.sh (to syncdb, migrate and loaddata)
$ python manage.py runserver
- Logged out, to receive confirmation requests by email
- Logged in, to get your comments accepted without requiring confirmation
- The first field represents the thread level.
- When in a thread it mentions the parent comment.
- The Blog contains Stories and Quotes. Instances of both models have comments. The blog index page shows the last 5 comments posted to either stories or quotes. It also gives access to the complete paginated list of comments.
- Project releases have comments as well but are not included in the complete paginated list of comments shown in the blog.
- The templatetag {% render_last_xtdcomments 5 for blog.story blog.quote %}
- And the following template files from the demos/multiple/templates directory:
- django_comments_xtd/blog/story/comment.html to render comments posted to stories
- django_comments_xtd/blog/quote/comment.html to render comments posted to quotes
- You may rather use a common template to render comments:
- For all blog app models: django_comments_xtd/blog/comment.html
- For all the website models: django_comments_xtd/comment.html
- An instance of a generic ListView class declared in blog/urls.py that uses the following queryset:
- XtdComment.objects.for_app_models("blog.story", "blog.quote")
- To format and render a comment in a markup language, make sure the first line of the comment looks like: #!<markup-language> being <markup-language> any of the following options:
- markdown
- restructuredtext
- linebreaks
- Then use the filter render_markup_comment with the comment field in your template to interpret the content (see demos/multiple/templates/comments/list.html).