Since django-knowledge ships with default themes and styles, you might have to spend a little time perfecting your look. However, it should work right out of the box with minimal setup (or none!) if you don’t mind the defaults.
The default base template is django_knowledge/base.html which contains a single {% block knowledge_inner %} tag. This base template loads two css files from your static (see below): reset.css and base.css.
If you do decide to change the base template via the KNOWLEDGE_BASE_TEMPLATE setting, your new template might look something like this:
<!doctype html>
<html lang="en">
<head>
<title>{% block title %}{% endblock title %} | Johnny's Support Center</title>
<link rel="stylesheet" href="{{ STATIC_URL }}css/my-own-reset.css">
<link rel="stylesheet" href="{{ STATIC_URL }}css/my-own-style.css">
<!-- don't forget to add me! -->
<link rel="stylesheet" href="{{ STATIC_URL }}knowledge/css/main.css">
</head>
<body>
<div class="wrapper">
<div class="header">
Welcome to the Johnny's app!
</div>
<div class="content">
{% block knowledge_inner %}
{% block content %}
<!-- your tradition content is loaded here if not django knowledge -->
{% endblock content %}
<!-- django knowlege is loaded here -->
{% endblock knowledge_inner %}
</div>
<div class="footer">
Copyright 2012
</div>
</div>
</body>
</html>
That isn’t to say that our css styles will fit in perfectly, but we’ve been careful to namespace under dk-` the majority of our css classes, so conflicts should be minimal.
1. Ensure static resources are loading for {{ STATIC_URL }}knowledge/css/reset.css and {{ STATIC_URL }}knowledge/css/main.css. 2. Done.
There are two very common areas for modification:
As long as you are using Django’s static files system, setting up static files should be as easy as python manage.py collectstatic. If not, you can always copy your files manually to a legacy MEDIA_URL and override the base template according to the above templates section.
Likewise, feel free to override the included CSS with your own rules in your own stylesheets. We’d recommend not editing the included CSS, as an update or collectstatic might overwrite them.
We purposefully namespace the majority of our CSS classes with dk- in order to keep them from conflicting with your existing CSS. There are two included CSS files: