Skip to main content

A Django app for managing re-usable blocks of tiny content.

Project description

https://travis-ci.org/dominicrodger/django-tinycontent.svg https://coveralls.io/repos/dominicrodger/django-tinycontent/badge.svg?branch=master&service=github

django-tinycontent is a simple Django application for re-usable content blocks, much like django-boxes.

Installation is simple:

pip install django-tinycontent

Add tinycontent to your INSTALLED_APPS.

Usage in templates is simple:

{% load tinycontent_tags %}

{% tinycontent_simple 'content_name' %}

Or, to specify a value if a content block by the given name cannot be found, use:

{% load tinycontent_tags %}

{% tinycontent 'content_name' %}
This will be shown if no matching object is found.
{% endtinycontent %}

The name of the content block can also be a context variable, using both the simple and the complex variants.

Content blocks themselves can be added and edited using Django’s admin interface. If a block with the name given in the template tag cannot be found, either nothing is rendered (if using tinycontent_simple), or the text between tinycontent and endtinycontent is rendered (if using the more complex variant).

To apply custom filters to your content, set TINYCONTENT_FILTER to a dotted path to a callable that takes the raw content and returns the transformed content. You can also set TINYCONTENT_FILTER to be a list of dotted paths to callables, to chain filters together.

django-tinycontent supports all versions of Django from 2.0 to 3.0. Python 3.6, 3.7 and 3.8 are supported.

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-tinycontent-0.8.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

django_tinycontent-0.8.0-py2.py3-none-any.whl (18.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file django-tinycontent-0.8.0.tar.gz.

File metadata

  • Download URL: django-tinycontent-0.8.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.5

File hashes

Hashes for django-tinycontent-0.8.0.tar.gz
Algorithm Hash digest
SHA256 0276f0d4196d1e6535c5c4a12fd543abb1704bd21240631341ca78b2b425e5f3
MD5 da407cf9457af673ad354d60b494fff4
BLAKE2b-256 234da0abb1acbc968851bcee36e0c6793020dc375eb4c6091ecb6a209cb5dd9d

See more details on using hashes here.

File details

Details for the file django_tinycontent-0.8.0-py2.py3-none-any.whl.

File metadata

  • Download URL: django_tinycontent-0.8.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.5

File hashes

Hashes for django_tinycontent-0.8.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 29dbd371edbaf6f3d477c46c6c01607e0f64ab16583229b3fc71cadf899ccc0e
MD5 2862988f62444af271877d79f8fe4f29
BLAKE2b-256 8dddc49f44cedf386dd5e6dc3c0661baa607c0628adce3946d901731dfd8c296

See more details on using hashes here.

Supported by

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