Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install django-cofingo

How to install django-cofingo

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install django-cofingo
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.2.2 Available View build log
0.2 Available View build log
0.1.4 Available View build log
0.1.3 Available View build log
0.1.2 Available View build log
0.1.1 Available View build log
Windows (64-bit)
0.2.2 Available View build log
0.2 Available View build log
0.1.4 Available View build log
0.1.3 Available View build log
0.1.2 Available View build log
0.1.1 Available View build log
Mac OS X (10.5+)
0.2.2 Available View build log
0.2 Available View build log
0.1.4 Available View build log
0.1.3 Available View build log
0.1.2 Available View build log
0.1.1 Available View build log
Linux (32-bit)
0.2.2 Available View build log
0.2 Available View build log
0.1.4 Available View build log
0.1.3 Available View build log
0.1.2 Available View build log
0.1.1 Available View build log
Linux (64-bit)
0.2.2 Available View build log
0.2 Available View build log
0.1.4 Available View build log
0.1.3 Available View build log
0.1.2 Available View build log
0.1.1 Available View build log
 
License
BSD
Lastest release
version 0.2.2 on Nov 20th, 2012

Cofingo is a combination of Coffin (http://github.com/coffin/coffin) and Jingo (http://github.com/jbalogh/jingo). It allows the usage of Jinja2 templates while keeping the tags and filters from Django (e.g. the URL tag)

Like Jingo the way to add custom filters, tags (extensions), and tests is by creating a helpers.py file in your app.

Getting started

The easiest way to install Cofingo is by using pip:

pip install django-cofingo

The development version can be found at:

http://github.com/mvantellingen/django-cofingo

Configuration

Add django_cofingo.Loader to your settings:

TEMPLATE_LOADERS = (
    'django_cofingo.Loader',
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
)

Templates are then rendered by Jinja2 whichever method is used (It works for class based views, TemplateResponse etc).

If you want to prevent that the templates of a specific app are rendered with Jinja2 then you can excluded them in your settings file:

COFINGO_EXCLUDED_APPS = ['admin', 'debug_toolbar']

(Note that these two apps are added by default)

Creating custom filters and extensions

Create a helpers module in your django app and add the following:

from django_cofingo.library import Library

library = Library()

If you want to add a filter add the following:

@library.filter
def my_custom_filter(value):
    return value + '-filtered'

Adding an extension can be done as follow:

from django_cofingo.library import Library
from django_assets.env import get_env
from webassets.ext.jinja2 import AssetsExtension

library = Library()
library.attr('assets_environment', get_env())
library.extension(AssetsExtension)

You can also add other modules with a library to Cofingo by specifying them in your settings.py file:

COFINGO_HELPERS = [
    'myproject.helpers'
]

Subscribe to package updates

Last updated Nov 20th, 2012

Download Stats

Last month:5

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.