Skip to main content

A library to make writing templatetags in Django sweet.

Here’s an example of using:

from django import template

from templatetag_sugar.register import tag
from templatetag_sugar.parser import Name, Variable, Constant, Optional, Model

register = template.Library()

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

Metadata

Release files for django-templatetag-sugar 1.0

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-templatetag-sugar 1.0
File Size Uploaded Provenance Actions
django-templatetag-sugar-1.0.tar.gz 2.8 kB Without provenance Details for django-templatetag-sugar-1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-templatetag-sugar 1.0
File Interpreter ABI Platform Actions
django_templatetag_sugar-1.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for django_templatetag_sugar-1.0-py2.py3-none-any.whl

Total release size: 8.0 kB

Release files / django-templatetag-sugar-1.0.tar.gz

Download URL django-templatetag-sugar-1.0.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e9f630549f6c174cf328b385190e18bfe308f74dc7eca13458163d316ed29a5e
BLAKE2b-256 checksum
How to use checksums
95450f2b31e4e86a9df1151c4c3a5f8ff1fb9bd882785d7c90ef1629fce37636
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_templatetag_sugar-1.0-py2.py3-none-any.whl

Download URL django_templatetag_sugar-1.0-py2.py3-none-any.whl
Size 5.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
90beafe5bc84686c328dcf685ce9f59f814104efd9a1fb5fb826e3ee3b7c2626
BLAKE2b-256 checksum
How to use checksums
7261ec7b883ff5f8d0641eea522b23e382918d214b27c1f63c5449ac0bcba1e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-templatetag-sugar 1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0 This release

2 release files No provenance

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