Configuration

This section describes how to:

Hook richtemplates into your project

This is done similar to other Django pluggable applications. Simply add richtemplates into your INSTALLED_APPS tuple at settings module.

Additionally, you need to add context processor provided by richtemplates at your settings module AND request context processor which boundled with Django but not included by default:

from django.conf import global_settings

# ...

TEMPLATE_CONTEXT_PROCESSORS = global_settings.TEMPLATE_CONTEXT_PROCESSORS + (
     'django.core.context_processors.request',
     'richtemplates.context_processors.media',
)

This would allow to use {{ RICHTEMPLATES_MEDIA_URL }} context variable in templates and it is necessary for richtemplates to work properly.

Import media files

If you have already hooked richtemplates into your project you can use management command in order to copy necessary media files. Simply run following command:

./manage.py import_media richtemplates

Use optional components

TODO: Write about other richtemplates features.

Configure settings

Following configuration settings may be overriden:

RICHTEMPLATES_MEDIA_URL

Default: same as django.conf.settings.MEDIA_URL + 'richtemplates/'

Used by context processor and provides RICHTEMPLATES_MEDIA_URL context variable in templates.

RICHTEMPLATES_SESSION_SKIN_NAME

Default: 'skin'

Used as key for skin field in sessions.

See Skins documentation.

RICHTEMPLATES_PROFILE_SKIN_FIELD

Default: 'skin'

If you want to make users able to save information about their chosen skin you need to specify field name (on user profile model) on which that information would be stored/fetched.

See Skins documentation.

RICHTEMPLATES_DEFAULT_SKIN

Default: 'aqua'

This is default skin alias for users who haven’t already choose a skin they want to use.

See Skins documentation.

RICHTEMPLATES_SKINS

Default:

{
    'aqua': {'name': 'Aqua'},
    'django': {'name': 'Django'},
    'ruby': {'name': 'Ruby'},
}

If you want to extend exising skins with your own you would need to specify proper dictionary. You should see Skins documentation.

RICHTEMPLATES_RESTRUCTUREDTEXT_DISALLOWED_DIRECTIVES

Default: ['include', 'meta', 'raw']

List of directives which would be registered with None object - this turns those directives off.

RICHTEMPLATES_RESTRUCTUREDTEXT_DIRECTIVES

Default: {}

richtemplates comes with some support for restructuredText. It is still undocumented.

RICHTEMPLATES_RESTRUCTUREDTEXT_PARSER_MAX_CHARS

Default: 5000

Maximum number of text that would be parsed for restructured text preview. If this number is exceeded, error message would returned as preview.