Skip to main content

Simple template tag for Django to collapse whitespace

Project description

A simple whitespace-collapsing template tag for Django - useful for formatting plain text emails or when whitespace actually matters.

Installation

  • Install to PYTHONPATH, etc.

Then either:

  • Add collapse_whitespace_templatetag to settings.INSTALLED_APPS and then use:

    {% load collapse_whitespace_templatetag %}

    … in your templates.

Or:

  • Add collapse_whitespace_templatetag.templatetags.collapse_whitespace to your BUILTINS entry in settings.TEMPLATES (Django 1.9)

Or:

  • Add to builtins (< Django 1.9) with in some models.py:

    from django.template.base import add_to_builtins
    add_to_builtins('collapse_whitespace_templatetag.templatetags.collapse_whitespace'

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

File details

Details for the file django-collapse-whitespace-templatetag-1.0.0.tar.gz.

File metadata

File hashes

Hashes for django-collapse-whitespace-templatetag-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e6fc309ad2afdcc67839864795e034ca87fcf192ecc992c8120315a0cb50b907
MD5 3440b85a000f6a3839e8001b32c60b20
BLAKE2b-256 35aa951620af4d3345ba925fc016a770e024a282ec5d907294b8c8bd0ca68632

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