Project

General

Profile

django-context-extras README

django-context-extras is a simple Django app that provides some extra context processors for your Django based projects.

Development Web Site: Public Source Code Repository:

Installation

Add it to the INSTALLED_APPS in settings.py:

INSTALLED_APPS = (
    ...
    'context_extras',
)

Configuration

django-context-extras requires no configuration. However, in order to use the provided context processors it is required that you add them to the list of the context processors your project uses.

Django, by default, uses the following context processors:

TEMPLATE_CONTEXT_PROCESSORS = (
    "django.contrib.auth.context_processors.auth",
    "django.core.context_processors.debug",
    "django.core.context_processors.i18n",
    "django.core.context_processors.media",
    "django.contrib.messages.context_processors.messages" 
)

See: http://docs.djangoproject.com/en/1.2/ref/settings/#template-context-processors

The context processors provided by django-context-extras are:

current_site context processor

Adds the current "site" object to the template context.

To add the 'current_site' context processor to your project, add the 'context_extras.context_processors.current_site' module in the TEMPLATE_CONTEXT_PROCESSORS setting in your settings.py file

TEMPLATE_CONTEXT_PROCESSORS = (
    ...
    'context_extras.context_processors.current_site',
    ...
)

project_settings context processor

Adds the project's "settings" object to the template context.

To add the 'project_settings' context processor to your project, add the'context_extras.context_processors.project_settings' module in the TEMPLATE_CONTEXT_PROCESSORS setting in your settings.py file

TEMPLATE_CONTEXT_PROCESSORS = (
    ...
    'context_extras.context_processors.project_settings',
    ...
)

License

Copyright (c) 2010 George Notaras <>

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

A copy of the License exists in the product distribution; the LICENSE file.
For copyright notes please read the NOTICE file.