Skip to main content

No project description provided

Project description

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...

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.4.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

django_gizmo-0.0.4-py2.4.egg (12.7 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for django-gizmo-0.0.4.tar.gz
Algorithm Hash digest
SHA256 706a3ec6bd54327e8bae51a9d63be411b2c36f79e606176e7c72deec8b57e13a
MD5 59bc96b54c9ac0e10197564f4a44f231
BLAKE2b-256 9ca31eafe87fcc155d16408133ec24d705bdf88439a554338013cd5c62600ad3

See more details on using hashes here.

File details

Details for the file django_gizmo-0.0.4-py2.4.egg.

File metadata

File hashes

Hashes for django_gizmo-0.0.4-py2.4.egg
Algorithm Hash digest
SHA256 4a07df5955e344dee2bc2acb91798375e199a871c5ad17d7b5e7e25a89471b39
MD5 7ffff64f2ed950c799ccf3f70f9f85b4
BLAKE2b-256 ce530d6541ac173eca4db787cd1dc5fa45ccd1d99b52f109a2df05710b1b5749

See more details on using hashes here.

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