Skip to main content

django-flatblocks

django-flatblocks is a simple application for handling small text-blocks on websites. Think about it like django.contrib.flatpages just not for a whole page but for only parts of it, like an information text describing what you can do on a site.

Usage

Once you’ve created some instances of the flatblocks.models.FlatBlock model, you can load it it using the flatblock_tags templatetag-library:

{% load flatblock_tags %}

<html>
    <head>
        <!-- ... -->
    </head>
    <body>
        <div id="page">
            <div id="main">
                <!-- ... -->
            </div>
            <div id="sidebar">
                {% flatblock "page.info" %}
            </div>
        </div>
    </body>
</html>

This way you can display a text block with the name ‘page.info’. If you have the name of a block in a template variable, leave out the quotes.

This tag also accepts an optional argument where you can specify the number of seconds, the that block should be cached:

{% flatblock "page.info" 3600 %}

History

Since this application targets use-cases that are basically applicable to most web-projects out there, there are tons of solutions similar to this one. In fact, this app is a fork originally from django-chunks developed by Clint Ecker.

In November 2008 Kevin Fricovsky created the original fork in order to add an additional “active”-flag to each chunk. That project was later on forked by Peter Baumgardner who removed that flag again and added a “header”-field in order to directly associate and optional title with each text block.

This fork aims now to add more features like variable chunks and also integrate some of the features developed by H. Waara and S. Cranford in the django-better-chunks fork (django.contrib.site- and i18n-support).

Metadata

Release files for django-flatblocks 0.1.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-flatblocks 0.1.0
File Size Uploaded
django-flatblocks-0.1.0.tar.gz 10.8 kB Details

Release files / django-flatblocks-0.1.0.tar.gz

Download URL django-flatblocks-0.1.0.tar.gz
Size 10.8 kB
Tags Source
SHA-256 checksum
How to use checksums
2ea4482f7750dadbcb1ffc6192203a40a259aae0fe15e91fce850b75bc551e4d
BLAKE2b-256 checksum
How to use checksums
e34d1c25b1b569d119193ffbfc0f4fd07b458bf0316a7810ea1f55a990712247
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.0.0

2 release files

0.9.4

1 release file

0.9.3

1 release file

0.9.2

1 release file

0.9.1

1 release file

0.9

1 release file

0.8

1 release file

0.7.1

1 release file

0.7.0

1 release file

0.6.0

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.0

1 release file

0.3.5

1 release file

0.3.4

1 release file

0.3.3

2 release files

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.0

1 release file

This release

0.1.0 This release

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