Simple knowledge base made with django
- Install or add
django-kb
to your Python path, i.e.:
$ pip install django-kb
Add
kb
to yourINSTALLED_APPS
setting.Add kb url include to your project's
urls.py
file with namespaecekb
:(r'^', include('kb.urls', namespace='kb')),
Add
kb.middleware.KnowledgeMiddleware
to yourMIDDLEWARE_CLASSES
setting, i.e.:MIDDLEWARE_CLASSES = ( ... "kb.middleware.KnowledgeMiddleware", )
Loading the tags, i.e.:
{% load kbtags %}
Return the new published articles.
Return the most viewed 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.
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 of the app django-kb running on Openshift here.