Skip to content

mrsarm/django-common-context

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Django Common Context Processors

Django Common Context Processors provides useful shortcuts for developing Django projects.

To use it, put in TEMPLATE_CONTEXT_PROCESSORS:

TEMPLATE_CONTEXT_PROCESSORS = (
    #...
    'common_context.context_processors.site',
    'common_context.context_processors.settings',
    #...

If you use Django 1.8+, set the context_processors option in the OPTIONS of a DjangoTemplates backend instead (see here).

Then in any page if you need to print the Site Name use:

{{ site.name }}

Or if you need to get the value of a Django Settings parameter:

{{ settings.ANY_SETTINGS_VALUE }}

About

This sources are available in https://github.com/mrsarm/django-common-context

Author: Mariano Ruiz <mrsarm@gmail.com>

License: LGPL-3 (C) 2014-2015

About

Django Common Context Processors provides useful shortcuts for developing Django projects

Resources

License

LGPL-3.0, GPL-3.0 licenses found

Licenses found

LGPL-3.0
COPYING.LESSER
GPL-3.0
COPYING

Stars

Watchers

Forks

Packages

No packages published

Languages