Skip to main content

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

Project description

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.

django-tinycontent supports all versions of Django from 1.4 to 1.8. Python 3.3 or 3.4 are supported for versions of Django from 1.5.

Changelog

v0.2.0

  • Dropped support for Python 2.6.

  • Added a built-in markdown filter - you can use it by setting TINYCONTENT_FILTER to 'tinycontent.filters.md.markdown_filter'.

  • Added the ability to include links to files which you can upload via the admin.

  • Added support for setting TINYCONTENT_FILTER to a list of dotted paths, to allow chaining filters.

v0.1.8

  • Added the TINYCONTENT_FILTER setting for controlling the way content is output.

  • Improved testing with Travis (we now test all supported Python versions and Django versions).

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.2.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

django_tinycontent-0.2.0-py2-none-any.whl (17.1 kB view details)

Uploaded Python 2

File details

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

File metadata

File hashes

Hashes for django-tinycontent-0.2.0.tar.gz
Algorithm Hash digest
SHA256 359e54542b95dc3cf115f63eca7d87e46e805fe43f8e56e791a9b11c212b2bdf
MD5 cce15882c3104f07fc612cb7363e6a5c
BLAKE2b-256 821b0bee7112fc7b228473e0236aaabf5e773f4f3dfd359b33b3f20089ec0697

See more details on using hashes here.

File details

Details for the file django_tinycontent-0.2.0-py2-none-any.whl.

File metadata

File hashes

Hashes for django_tinycontent-0.2.0-py2-none-any.whl
Algorithm Hash digest
SHA256 d4e7459920b9420d864651858f4159828fa61a8f39db25fced3363fb290e0056
MD5 2cb90ce2c86ae5e40ea382184381b0a7
BLAKE2b-256 c67e442d31246b7bff6506ae76d1303658c0b4d22288931080a50aed0b156035

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