Configuration — django-richtemplates v0.3.beta documentation

### Navigation

- index
- modules |
- next |
- previous |
- django-richtemplates v0.3.beta documentation »

# Configuration

This section describes how to:

- Hook richtemplates into your project
- Import media files
- Use optional components
- Configure settings

## 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:

    1
    2
    3
    4
    5
    6
    7
    8
    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:

    1
    ./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
- RICHTEMPLATES_SESSION_SKIN_NAME
- RICHTEMPLATES_PROFILE_SKIN_FIELD
- RICHTEMPLATES_DEFAULT_SKIN
- RICHTEMPLATES_SKINS
- RICHTEMPLATES_RESTRUCTUREDTEXT_DIRECTIVES

`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:

      1
      2
      3
      4
      5
      {
          '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_DIRECTIVES`

  Default: `{}`

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

### Navigation

- index
- modules |
- next |
- previous |
- django-richtemplates v0.3.beta documentation »