Skip to main content

Django app allowing for configurable targetting of template inclusion tags.

Project description

Django Gizmo

Django app allowing for configurable targetting of template inclusion tags.

Installation

  1. Add gizmo to your INSTALLED APPS setting.

  2. Add ROOT_GIZMOCONF value to your projects settings file. This specifies the module in which your configured your gizmos, i.e.:

    ROOT_GIZMOCONF = 'project.gizmos'

    In this case we have a module called project containing a gizmos.py file.

  3. Create your gizmos config (in this cased named gizmos.py) file in the form:

    gizmos = (
        ('<loader name>', '<tag name>', '<slot name>', [['<url_name'>, ]]),
    )

With:

  • <loader name> being the name you would normally pass to Django’s load tag, i.e. myapp_inclusion_tags for {% load myapp_inclusion_tags %}.

  • <tag name> being the name of the tag you want to include, i.e. advert for {% advert %}.

  • <slot name> being the name of the slot you want the tag to show up in, i.e. home.

  • <url_name> optional being the names of the urls you want the tag to show up in, i.e. home.

Usage

Gizmos are stock standard Django inclusion tags. The only diffirence is that instead of specifying tags within a template you specify tags from a distance by using a gizmo conf file in conjunction with the gizmos tag.

For example, lets say we have an advert tag specified in myapp’s inclusion tags which we only want to call in the gizmo slot named advert for the url named home:

  1. Create your tags as normal.

  2. Create your gizmos config file in the form:

    gizmos = (
        ('myapp_inclusion_tag', 'advert', 'advert', ['home', ]),
    )
  3. In your template for the home view load the gizmo inclusion tags and include a gizmos tag with a slot name of advert:

    {% load gizmo_inclusion_tags %}
    
    ...some html...
    
    {% gizmos 'home_advert' %}
    
    ...some more html...

Authors

Praekelt Foundation

  • Shaun Sephton

  • Jonathan Bydendyk

Changelog

0.0.3

  1. Bring packaging up to standard.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-gizmo-0.0.3.tar.gz (6.0 kB view details)

Uploaded Source

Built Distributions

django_gizmo-0.0.3-py2.7.egg (12.6 kB view details)

Uploaded Source

django_gizmo-0.0.3-py2.6.egg (12.6 kB view details)

Uploaded Source

File details

Details for the file django-gizmo-0.0.3.tar.gz.

File metadata

File hashes

Hashes for django-gizmo-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ef6c51ef3b862b61b0cb1bb06c438461dcdf4be23f37023c172657b4e1322a3e
MD5 fbb673451c87437cbb0d9314ddd772f9
BLAKE2b-256 3c70f308ab32989c7c61783d002014fbd027bb9b33e7332ee5b27d40db446e9f

See more details on using hashes here.

Provenance

File details

Details for the file django_gizmo-0.0.3-py2.7.egg.

File metadata

File hashes

Hashes for django_gizmo-0.0.3-py2.7.egg
Algorithm Hash digest
SHA256 98ef49d0f4eaadc6f00971726acf05e1c0fb59afd03567466671c0568ffe6dc1
MD5 8aea7bb473c2f6cfdf6a14ae78d547c2
BLAKE2b-256 3b9f8262ebbc91c4e9d033720ebcc189628fc6c054621a91fe9ae80380277a6f

See more details on using hashes here.

Provenance

File details

Details for the file django_gizmo-0.0.3-py2.6.egg.

File metadata

File hashes

Hashes for django_gizmo-0.0.3-py2.6.egg
Algorithm Hash digest
SHA256 d403bc97cd3027010eda8f737cfed71b87d98d4fc85d68e05deed4c435855b80
MD5 53586acbdefcbbd09c759354012428de
BLAKE2b-256 ef8617e328cb1d1a7555c23ea2d8dbf94ea109f92ace7fc788d64fef652d0163

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page