Skip to main content

A library to make Django's template tags sweet.

Project description

A library to make writing templatetags in Django sweet.

Here’s an example of using:

@tag(register, [Constant("for"), Variable(), Optional([Constant("as"), Name()])]):
def example_tag(context, val, asvar=None):
    if asvar:
        context[asvar] = val
        return ""
    else:
        return val

As you can see it makes it super simple to define the syntax for a tag.

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-templatetag-sugar-0.1.tar.gz (2.4 kB view details)

Uploaded Source

File details

Details for the file django-templatetag-sugar-0.1.tar.gz.

File metadata

File hashes

Hashes for django-templatetag-sugar-0.1.tar.gz
Algorithm Hash digest
SHA256 d41277be9ed9356838969e3f90ef5cf80a197e64f298e93b3bf62f380cc96e4a
MD5 f5b8bf6e4cb82f8affa761574bf3dae4
BLAKE2b-256 c07909b83a88e6b0ef00ef5472179da2680fd2f3d52d2a84327916fe11629c7a

See more details on using hashes here.

Supported by

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