Skip to main content

toggly-django

Feature blocks

With toggly-django 0.4.0+, render enabled and disabled content using matching iffeature blocks. Set negate=True on the disabled block:

{% load toggly_tags %}
{% iffeature "new-navigation" %}
  <nav>New navigation</nav>
{% endiffeature %}
{% iffeature "new-navigation" negate=True %}
  <nav>Classic navigation</nav>
{% endiffeature %}

negate accepts Django template expressions such as negate=show_disabled or negate=options.reverse|default:False, resolved on each render. Use the boolean True rather than the nonempty string "False", which is truthy. The feature key keeps its existing literal interpretation, whether quoted or unquoted. Both blocks evaluate the same current request context; negation applies to the result. If no client is configured, the positive block is hidden and the negated block renders. Only the selected block renders its children; Django autoescaping is preserved. These presentation gates do not replace authorization.

The legacy {% else %} branch remains supported for compatibility. It renders when the final result, including any negation, is false. Prefer paired blocks in new templates. Programmatic boolean helpers and view decorators are unchanged.

Feature variants

Requires toggly 1.0.0+. Feature variants are assigned locally from the same cached definitions used for iffeature/is_feature_enabled — there is no separate "variants mode" to enable.

# settings.py
TOGGLY = {
    "APP_KEY": "your-app-key",
    "IDENTITY": "user-123",  # Default identity used when a request/user_id isn't supplied.
}
from toggly_django.utils import get_client

client = get_client()
variant = client.get_variant("checkout-flow", user_id=str(request.user.pk))
if variant is not None and variant.enabled and variant.name == "B":
    ...

See the core toggly package README for the full get_variant / get_variant_value API and the Microsoft.FeatureManagement-parity assignment rules.

Metadata

Release files for toggly-django 0.5.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 toggly-django 0.5.0
File Size Uploaded Provenance Actions
toggly_django-0.5.0.tar.gz 15.2 kB With provenance Details for toggly_django-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for toggly-django 0.5.0
File Interpreter ABI Platform Actions
toggly_django-0.5.0-py3-none-any.whl Python 3 none any Details for toggly_django-0.5.0-py3-none-any.whl

Total release size: 27.5 kB

Release files / toggly_django-0.5.0.tar.gz

Download URL toggly_django-0.5.0.tar.gz
Size 15.2 kB
Tags Source
SHA-256 checksum
How to use checksums
16723e404bf054812a17829349289d9ee9eda5e7cb36c70e7ad3a9f8af9e9355
BLAKE2b-256 checksum
How to use checksums
90de5ad83e68ca33c769b7cfc02bda8ec967790126590eb1c46642efaa5ee815
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release files / toggly_django-0.5.0-py3-none-any.whl

Download URL toggly_django-0.5.0-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
95c9c99f0440a7183e1c80d4e8f1e4a25ea426acf578607dd5a2894e52f20077
BLAKE2b-256 checksum
How to use checksums
8c005986adbe9c0e4fbd34aff9317db6946b6389b3a18759ade38e1d0b0bd68e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Security for toggly-django 0.5.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for toggly_django-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

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.

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