Configuration

To use django-djeddit in a project, add it to your INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'crispy_forms',
    'mptt',
    'djeddit',
    'meta',
    ...
    ]

And djeddit_settings to context_processors:

'context_processors': [
    ...
    'djeddit.context_processors.djeddit_settings',
    ...
]

Add django-djeddit’s URL patterns:

urlpatterns = [
    ...
    url(r'^', include('djeddit.urls')),
    ...
]

Migrate models:

python manage.py migrate djeddit

Additional Options

By default the base template is djeddit/base.html

You can change the default base template in settings.py:

DJEDDIT_BASE_TEMPLATE = "path/to/template.html"

In order for the base template to work properly with the app’s templtes it needs to contain the following:

within <head>…</head>:

{% load staticfiles %}
{% include 'djeddit/base_stylesheets.html' %}

within <body>…</body>:

{% block title %}{% endblock %}
{% block content %}{% endblock %}
{% block scripts %}{% endblock %}
{% include 'djeddit/base_scripts.html' %}
{% block scripts %}{% endblock %}

You can use the structue of djeddit/base.html for reference.

SiteMap

If you’d like djeddit to generate sitemaps for SEO you can follow these steps. Djeddit comes with a sitemaps.py file included and you just have to enable it.

Add the following apps to your installed apps if they are not already there

'django.contrib.sites',
'django.contrib.sitemaps',

Create the sitemaps dictionary with the djeddit sitemap and core django sitemap imports in the urls.py of your project

Now add the following to your urlpatterns

url(r'^sitemap\.xml$', sitemap, {'sitemaps': sitemaps}, name='django.contrib.sitemaps.views.sitemap'),

Run migrations and run server

If you visit sitemap.xml on your site you should have a working sitemap for djeddit threads.