Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

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.


  • Install to PYTHONPATH, etc.

Then either:

  • Add collapse_whitespace_templatetag to settings.INSTALLED_APPS and then use:

    {% load collapse_whitespace_templatetag %}

    … in your templates.


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


  • Add to builtins (< Django 1.9) with in some

    from django.template.base import add_to_builtins

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-collapse-whitespace-templatetag, version 1.0.2
Filename, size File type Python version Upload date Hashes
Filename, size django-collapse-whitespace-templatetag-1.0.2.tar.gz (2.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page