Skip to main content

django-siteblocks

https://github.com/idlesign/django-siteblocks

release lic coverage

What's that

django-siteblocks is a reusable application for Django to build blocks of static or dynamic data that could be used in templates.

It allows you to describe data that doesn't clearly belong to any application in your project in terms of static or dynamic blocks, that could be rendered in certain places on site pages. These blocks are addressed in templates by their aliases.

The following siteblock types are supported:

Static

Those are defined using Django Admin contrib and are linked to certain URLs.

This allows different siteblock contents on different URLs. Just go to admin and add some blocks.

Dynamic

Those are ordinary Python functions registered as siteblocks returning contents.

This allows complex logic to build siteblock contents. Let's make a block with a random quote from Pratchett:

from random import choice

from siteblocks.siteblocksapp import register_dynamic_block


def get_quote(**kwargs):
    quotes = [
        'Early to rise, early to bed, makes a man healthy, wealthy and dead.',
        'The duke had a mind that ticked like a clock and, like a clock, it regularly went cuckoo.',
        'Speak softly and employ a huge man with a crowbar.',
    ]
    return choice(quotes)

register_dynamic_block('quote', get_quote)

Block rendering

Use siteblocks tag to render block contents where you need it.

{% load siteblocks %}

<div class="quote">
    {% siteblock "quote" %}
</div>

Documentation

https://django-siteblocks.readthedocs.io/

Metadata

Release files for django-siteblocks 1.2.2

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-siteblocks 1.2.2
File Size Uploaded Provenance Actions
django_siteblocks-1.2.2.tar.gz 10.4 kB Without provenance Details for django_siteblocks-1.2.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-siteblocks 1.2.2
File Interpreter ABI Platform Actions
django_siteblocks-1.2.2-py3-none-any.whl Python 3 none any Details for django_siteblocks-1.2.2-py3-none-any.whl

Total release size: 28.4 kB

Release files / django_siteblocks-1.2.2.tar.gz

Download URL django_siteblocks-1.2.2.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
25ae226298ec6df4a2588565a90b91b539afb32d3e90b3927c309e790e3753ae
BLAKE2b-256 checksum
How to use checksums
3a6b6fbfcb74b4a9791f1c4efbd4ae444e40e0ce40d2b721390ce2f117912a0e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / django_siteblocks-1.2.2-py3-none-any.whl

Download URL django_siteblocks-1.2.2-py3-none-any.whl
Size 18.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88302082bb6a1f84929b826219eb7202b695f122e0f1f8b24fd8e684e5dbe044
BLAKE2b-256 checksum
How to use checksums
f35050a1debcf8ce19b27755d4355daa52fd2ee80ce245db55bf896a8d76b00e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for django-siteblocks 1.2.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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