Skip to main content
Travis Status Coverage Status Requirements Status

Django FlatContent is intended as a flatpages-like app but for smaller chunks of content that can be edited in the Django admin.

Features

  • Simple FlatContent model

  • Template tag for pulling FlatContent into templates

  • Template rendering of flatcontent items

  • Caching of FlatContent for performance

Installation

  1. pip install flatcontent.

  2. Add flatcontent to your INSTALLED_APPS.

  3. Run the command manage.py migrate to install the models.

Usage

Once content is available in the FlatContent model, it can be accessed via the templates using the provided template tags:

{% load flatcontent_tags %}
<div id="footer">
    {% flatcontent footer %}
</div>

The above will perform a slug lookup on the text “footer” and return the content associated with that slug.

You can also put the content into a template variable for passing to other template tags or filters. For example, getting the footer and processing the text through the textile filter:

{% load flatcontent_tags markup %}
<div id="footer">
    {% flatcontent footer as content %}
    {{ content|textile }}
</div>

Add context for flatcontent rendering using the with keyword. For example, if you have a flatcontent item with the content Homer {{ last_name }}, you could use the following in your django template to achieve Homer Simpson as the output:

{% load flatcontent_tags %}
{% flatcontent homer-simpson with last_name='Simpson' %}

Metadata

Release files for django-flatcontent 0.2.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 django-flatcontent 0.2.0
File Size Uploaded
django-flatcontent-0.2.0.tar.gz 10.2 kB Details

Release files / django-flatcontent-0.2.0.tar.gz

Download URL django-flatcontent-0.2.0.tar.gz
Size 10.2 kB
Tags Source
SHA-256 checksum
How to use checksums
e9730a3f593ee5269795b254294d034e63d20355abeb8eb83e82acbc59ef6fa1
BLAKE2b-256 checksum
How to use checksums
e2c5fb1b4f848bda6c4e4a94d929b09e0b9feff25bf2b9f643c3a562f54a42ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file

0.1.7

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

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