{"id":15658400,"url":"https://github.com/idlesign/django-siteblocks","last_synced_at":"2025-05-01T09:57:35.225Z","repository":{"id":57422046,"uuid":"709184","full_name":"idlesign/django-siteblocks","owner":"idlesign","description":"Reusable application for Django to build blocks of static or dynamic data that could be used in templates.","archived":false,"fork":false,"pushed_at":"2022-02-04T12:49:21.000Z","size":108,"stargazers_count":22,"open_issues_count":0,"forks_count":9,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-01T09:57:29.259Z","etag":null,"topics":["blocks","django","python","widgets"],"latest_commit_sha":null,"homepage":"http://github.com/idlesign/django-siteblocks","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/idlesign.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-06-08T09:47:43.000Z","updated_at":"2024-06-02T19:47:52.000Z","dependencies_parsed_at":"2022-09-06T07:11:53.719Z","dependency_job_id":null,"html_url":"https://github.com/idlesign/django-siteblocks","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fdjango-siteblocks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fdjango-siteblocks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fdjango-siteblocks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/idlesign%2Fdjango-siteblocks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/idlesign","download_url":"https://codeload.github.com/idlesign/django-siteblocks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251856992,"owners_count":21655119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blocks","django","python","widgets"],"created_at":"2024-10-03T13:12:20.351Z","updated_at":"2025-05-01T09:57:35.191Z","avatar_url":"https://github.com/idlesign.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"django-siteblocks\n=================\nhttp://github.com/idlesign/django-siteblocks\n\n.. image:: https://img.shields.io/pypi/v/django-siteblocks.svg\n    :target: https://pypi.python.org/pypi/django-siteblocks\n\n.. image:: https://img.shields.io/pypi/l/django-siteblocks.svg\n    :target: https://pypi.python.org/pypi/django-siteblocks\n\n.. image:: https://img.shields.io/coveralls/idlesign/django-siteblocks/master.svg\n    :target: https://coveralls.io/r/idlesign/django-siteblocks\n\n.. image:: https://img.shields.io/travis/idlesign/django-siteblocks/master.svg\n    :target: https://travis-ci.org/idlesign/django-siteblocks\n\n\nWhat's that\n-----------\n\n*django-siteblocks is a reusable application for Django to build blocks of static or dynamic data that could be used in templates.*\n\nIt allows you to describe data that doesn't clearly belong to any application in your project in terms of static or dynamic blocks,\nthat could be rendered in certain places on site pages. These blocks are addressed in templates by their aliases.\n\nThe following siteblock types are supported:\n\nStatic\n~~~~~~\nThose are defined using Django Admin contrib and are linked to certain URLs.\n\nThis allows different siteblock contents on different URLs. Just go to admin and add some blocks.\n\nDynamic\n~~~~~~~\n\nThose are ordinary Python functions registered as siteblocks returning contents.\n\nThis allows complex logic to build siteblock contents. Let's make a block with a random quote from Pratchett:\n\n.. code-block:: python\n\n        from random import choice\n\n        from siteblocks.siteblocksapp import register_dynamic_block\n\n\n        def get_quote(**kwargs):\n            quotes = [\n                'Early to rise, early to bed, makes a man healthy, wealthy and dead.',\n                'The duke had a mind that ticked like a clock and, like a clock, it regularly went cuckoo.',\n                'Speak softly and employ a huge man with a crowbar.',\n            ]\n            return choice(quotes)\n\n        register_dynamic_block('quote', get_quote)\n\n\nBlock rendering\n---------------\n\nUse ``siteblocks`` tag to render block contents where you need it.\n\n.. code-block:: html\n\n    {% load siteblocks %}\n\n    \u003cdiv class=\"quote\"\u003e\n        {% siteblock \"quote\" %}\n    \u003c/div\u003e\n\n\nDocumentation\n-------------\n\nhttp://django-siteblocks.readthedocs.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidlesign%2Fdjango-siteblocks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fidlesign%2Fdjango-siteblocks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fidlesign%2Fdjango-siteblocks/lists"}