Skip to content
This repository has been archived by the owner on Jun 29, 2019. It is now read-only.

eliostvs/django-kb

Repository files navigation

Django KB

Latest Version Supported Python versions Download format https://travis-ci.org/eliostvs/django-kb.png?branch=master https://coveralls.io/repos/eliostvs/django-kb/badge.png?branch=master

Simple knowledge base made with django

Installation

  1. Install or add django-kb to your Python path, i.e.:
$ pip install django-kb
  1. Add kb to your INSTALLED_APPS setting.

  2. Add kb url include to your project's urls.py file with namespaece kb:

    (r'^', include('kb.urls', namespace='kb')),
    
  3. Add kb.middleware.KnowledgeMiddleware to your MIDDLEWARE_CLASSES setting, i.e.:

    MIDDLEWARE_CLASSES = (
        ...
        "kb.middleware.KnowledgeMiddleware",
    )
    

Usage

Template Tags

Loading the tags, i.e.:

{% load kbtags %}

{% top_new_articles %}

Return the new published articles.

{% top_viewed_articles %}

Return the most viewed articles.

{% top_rated_articles %}

Return the most rated articles.

All this tags accept two optional parameters, num and category. num is the number of the articles that will return, by default to 5. category can be a model or slug that will be used to filter the articles.

{% feedback %}

This is an inclusion tag which renders links to upvote or downvote the article.

To support AJAX you need to load jQuery and the feedback.js in your template, i.e.:

{% load staticfiles %}
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript" src="{% static "kb/js/feedback.js" %}"></script>

Example

Example of the app django-kb running on Openshift here.

About

Simple knowledge base made with django

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published