Skip to main content

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.

Release files for django-gizmo 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-gizmo 0.0.3
File Size Uploaded
django-gizmo-0.0.3.tar.gz 6.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for django-gizmo 0.0.3
File Interpreter ABI Platform
django_gizmo-0.0.3-py2.7.egg Legacy Egg format - - Details
django_gizmo-0.0.3-py2.6.egg Legacy Egg format - - Details

Total release size: 31.2 kB

Release files / django-gizmo-0.0.3.tar.gz

Download URL django-gizmo-0.0.3.tar.gz
Size 6.0 kB
Tags Source
SHA-256 checksum
How to use checksums
ef6c51ef3b862b61b0cb1bb06c438461dcdf4be23f37023c172657b4e1322a3e
BLAKE2b-256 checksum
How to use checksums
3c70f308ab32989c7c61783d002014fbd027bb9b33e7332ee5b27d40db446e9f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_gizmo-0.0.3-py2.7.egg

Download URL django_gizmo-0.0.3-py2.7.egg
Size 12.6 kB
Tags Egg
SHA-256 checksum
How to use checksums
98ef49d0f4eaadc6f00971726acf05e1c0fb59afd03567466671c0568ffe6dc1
BLAKE2b-256 checksum
How to use checksums
3b9f8262ebbc91c4e9d033720ebcc189628fc6c054621a91fe9ae80380277a6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_gizmo-0.0.3-py2.6.egg

Download URL django_gizmo-0.0.3-py2.6.egg
Size 12.6 kB
Tags Egg
SHA-256 checksum
How to use checksums
d403bc97cd3027010eda8f737cfed71b87d98d4fc85d68e05deed4c435855b80
BLAKE2b-256 checksum
How to use checksums
ef8617e328cb1d1a7555c23ea2d8dbf94ea109f92ace7fc788d64fef652d0163
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.0.4

2 release files

This release

0.0.3 This release

3 release files

0.0.2

3 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page