django-render-block


Namedjango-render-block JSON
Version 0.10 PyPI version JSON
download
home_pagehttps://github.com/clokep/django-render-block
SummaryRender a particular block from a template to a string.
upload_time2024-07-15 20:33:06
maintainerNone
docs_urlNone
authorPatrick Cloke
requires_python>=3.8
licenseISC
keywords [django template block templates render context]
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Django Render Block
###################

.. image:: https://img.shields.io/pypi/v/django-render-block.svg
    :target: https://pypi.org/project/django-render-block/

.. image:: https://github.com/clokep/django-render-block/actions/workflows/main.yml/badge.svg
    :target: https://github.com/clokep/django-render-block/actions/workflows/main.yml

Render the content of a specific block tag from a Django template. Works for
arbitrary template inheritance, even if a block is defined in the child template
but not in the parent. Generally it works like ``render_to_string`` from Django,
but allows you to specify a block to render.

Features
========

*   Render a specific block from a template
*   Fully supports the Django templating engine
*   Partially supports the `Jinja2 <http://jinja.pocoo.org/>`__ engine: it does
    not currently process the ``extends`` tag.

Requirements
============

Django Render Block supports Django 4.2, 5.0, and 5.1 on Python 3.8, 3.9, 3.10,
3.11 and 3.12 (see the Django documentation for which versions of Python are
supported by particular Django versions).

Examples
========

In ``test1.html``:

.. code-block:: jinja

    {% block block1 %}block1 from test1{% endblock %}
    {% block block2 %}block2 from test1{% endblock %}

In ``test2.html``:

.. code-block:: jinja

    {% extends 'test1.html' %}
    {% block block1 %}block1 from test2{% endblock %}

And from the Python shell:

.. code-block:: python

    >>> from render_block import render_block_to_string
    >>> print(render_block_to_string('test2.html', 'block1'))
    'block1 from test2'
    >>> print(render_block_to_string('test2.html', 'block2'))
    'block2 from test1'

It can also accept a context as a ``dict`` (just like ``render_to_string``), in
``test3.html``:

.. code-block:: jinja

    {% block block3 %}Render this {{ variable }}!{% endblock %}

And from Python:

.. code-block:: python

    >>> print(render_block_to_string('test3.html', 'block3', {'variable': 'test'}))
    'Render this test!'

API Reference
=============

The API is simple and attempts to mirror the built-in ``render_to_string`` API.

``render_block_to_string(template_name, block_name, context=None, request=None)``

    ``template_name``
        The name of the template to load and render. If it’s a list of template
        names, Django uses ``select_template()`` instead of ``get_template()``
        to find the template.

    ``block_name``
        The name of the block to render from the above template.

    ``context``
        A ``dict`` to be used as the template’s context for rendering. A ``Context``
        object can be provided for Django templates.

        ``context`` is optional. If not provided, an empty context will be used.

    ``request``
        The request object used to render the template.

        ``request`` is optional and works only for Django templates. If both context and request
        are provided, a ``RequestContext`` will be used instead of a ``Context``.

Exceptions
----------

Like ``render_to_string`` this will raise the following exceptions:

    ``TemplateDoesNotExists``
        Raised if the template(s) specified by ``template_name`` cannot be
        loaded.

    ``TemplateSyntaxError``
        Raised if the loaded template contains invalid syntax.

There are also two additional errors that can be raised:

    ``BlockNotFound``
        Raised if the block given by ``block_name`` does not exist in the
        template.

    ``UnsupportedEngine``
        Raised if a template backend besides the Django backend is used.

Contributing
============

If you find a bug or have an idea for an improvement to Django Render Block,
please
`file an issue <https://github.com/clokep/django-render-block/issues/new>`_ or
provide a pull request! Check the
`list of issues <https://github.com/clokep/django-render-block/issues/>`_ for
ideas of what to work on.

Attribution
===========

This is based on a few sources:

* Originally `Django Snippet 769 <https://djangosnippets.org/snippets/769/>`__
* Updated version `Django Snippet 942 <https://djangosnippets.org/snippets/942/>`__
* A version of the snippets was ported as `Django-Block-Render <https://github.com/uniphil/Django-Block-Render/>`_
* Additionally inspired by part of `django-templated-email <https://github.com/BradWhittington/django-templated-email/blob/master/templated_email/utils.py>`_
* Also based on a `StackOverflow answer 2687173 <http://stackoverflow.com/questions/2687173/django-how-can-i-get-a-block-from-a-template>`_

.. :changelog:

Changelog
#########

0.10 (July 15, 2024)
====================

No changes from 0.10b1.


0.10b1 (July 1, 2024)
=====================

Bugfixes
--------

* Fixes exception propagation when rendering templates. Contributed
  by `@yaakovLowenstein <https://github.com/yaakovLowenstein>`_. (`#52 <https://github.com/clokep/django-render-block/pull/52>`_)
* Fix rendering blocks over multiple extended templates. (`#56 <https://github.com/clokep/django-render-block/pull/56>`_)

Maintenance
-----------

* Support Python 3.11 and 3.12. (`#44 <https://github.com/clokep/django-render-block/pull/44>`_,
  `#55 <https://github.com/clokep/django-render-block/pull/55>`_)
* Drop support for Python 3.7. (`#44 <https://github.com/clokep/django-render-block/pull/44>`_)
* Support Django 4.2, 5.0 and 5.1. (`#44 <https://github.com/clokep/django-render-block/pull/44>`_,
  `#55 <https://github.com/clokep/django-render-block/pull/55>`_)
* Drop support for Django < 3.2; Django 4.0; Django 4.1. (`#44 <https://github.com/clokep/django-render-block/pull/44>`_,
  `#55 <https://github.com/clokep/django-render-block/pull/55>`_)
* Add type hints and configure mypy. (`#54 <https://github.com/clokep/django-render-block/pull/54>`_)


0.9.2 (October 18, 2022)
========================

Maintenance
-----------

* Drop support for Python 3.6. (`#36 <https://github.com/clokep/django-render-block/pull/36>`_)
* Improve package metadata. (`#37 <https://github.com/clokep/django-render-block/pull/37>`_)
* Run `black <https://black.readthedocs.io/>`_, `isort <https://pycqa.github.io/isort/>`_,
  and `flake8 <https://flake8.pycqa.org>`_, and `pyupgrade <https://github.com/asottile/pyupgrade>`_.
  (`#38 <https://github.com/clokep/django-render-block/pull/38>`_,
  `#39 <https://github.com/clokep/django-render-block/pull/39>`_)
* Update to include and run tests for Django 4.1. Contributed by
  `Jack Linke <https://github.com/jacklinke>`_.
  (`#41 <https://github.com/clokep/django-render-block/pull/41>`_)


0.9.1 (December 15, 2021)
=========================

Maintenance
-----------

* Support Python 3.10. (`#33 <https://github.com/clokep/django-render-block/pull/33>`_)
* Fixed a packaging issue where the generated wheels were empty. Contributed
  by `@cordery <https://github.com/cordery>`_. (`#35 <https://github.com/clokep/django-render-block/pull/35>`_)


0.9 (December 14, 2021)
=======================

Maintenance
-----------

* Drop support for Django 3.0. (`#31 <https://github.com/clokep/django-render-block/pull/31>`_)
* Support Django 3.2 and 4.0. (`#27 <https://github.com/clokep/django-render-block/pull/27>`_,
  `#31 <https://github.com/clokep/django-render-block/pull/31>`_)
* Switch continuous integration to GitHub Actions. (`#26 <https://github.com/clokep/django-render-block/pull/26>`_,
  `#28 <https://github.com/clokep/django-render-block/pull/28>`_)
* Changed packaging to use setuptools declarative config in ``setup.cfg``.
  (`#32 <https://github.com/clokep/django-render-block/pull/32>`_)


0.8.1 (October 15, 2020)
========================

Bugfixes
--------

* Fixes a regression in v0.8 where a ``Context`` could not be re-used. Contributed
  by `@evanbrumley <https://github.com/evanbrumley>`_. (`#25 <https://github.com/clokep/django-render-block/pull/25>`_)


0.8 (October 6, 2020)
=====================

Bugfixes
--------

* ``render_block_to_string`` now forwards the ``Context`` passed as ``context`` parameter.
  Contributed by `@bblanchon <https://github.com/bblanchon>`_. (`#21 <https://github.com/clokep/django-render-block/pull/21>`_)

Maintenance
-----------

* Drop support for Python 3.5, support Python 3.9. (`#22 <https://github.com/clokep/django-render-block/pull/22>`_)


0.7 (July 13, 2020)
===================

Maintenance
-----------

* Drop support for Django < 2.2. (`#18 <https://github.com/clokep/django-render-block/pull/18>`_)
* Support Django 3.0 and 3.1. (`#18 <https://github.com/clokep/django-render-block/pull/18>`_,
  `#20 <https://github.com/clokep/django-render-block/pull/20>`_)
* Drop support for Python 2.7. (`#19 <https://github.com/clokep/django-render-block/pull/19>`_)
* Support Python 3.8. (`#18 <https://github.com/clokep/django-render-block/pull/18>`_)


0.6 (May 8, 2019)
=================

Improvements
------------

* ``render_block_to_string`` now optionally accepts a ``request`` parameter.
  If given, a ``RequestContext`` instead of a ``Context`` is used when
  rendering with the Django templating engine. Contributed by
  `@vintage <https://github.com/vintage>`_. (`#15 <https://github.com/clokep/django-render-block/pull/15>`_)

Maintenance
-----------

* Support Django 1.11, 2.1, and 2.2. (`#9 <https://github.com/clokep/django-render-block/pull/9>`_,
  `#11 <https://github.com/clokep/django-render-block/pull/11>`_,
  `#17 <https://github.com/clokep/django-render-block/pull/17>`_)
* Support Python 2.7, 3.5, 3.6, and 3.7. (`#9 <https://github.com/clokep/django-render-block/pull/9>`_,
  `#17 <https://github.com/clokep/django-render-block/pull/17>`_)
* Fix rendering of README on PyPI. Contributed by `@mixxorz <https://github.com/mixxorz>`_.
  (`#10 <https://github.com/clokep/django-render-block/pull/10>`_)


0.5 (September 1, 2016)
=======================

Bugfixes
--------

* Fixes a major issue with inheriting templates and rendering a block found in
  the parent template, but overwriting part of it in the child template.
  (`#8 <https://github.com/clokep/django-render-block/pull/8>`_)


0.4 (August 4, 2016)
====================

Improvements
------------

* Initial support for using the `Jinja2 <http://jinja.pocoo.org/>`_ templating
  engine. See README for caveats. (`#3 <https://github.com/clokep/django-render-block/pull/3>`_)

Maintenance
-----------

* Support Django 1.10. (`#5 <https://github.com/clokep/django-render-block/pull/5>`_)
* Support Python 3. (`#6 <https://github.com/clokep/django-render-block/pull/6>`_)


0.3.1 (June 1, 2016)
====================

Maintenance
------------

* Refactoring to make more generic (for potentially supporting multiple
  templating engines).


0.3 (May 27, 2016)
==================

* Largely rewritten.
* Support Django 1.8 and 1.9:

  * Guards against different template backends.
  * Uses internal APIs for each node.
  * Removed ``context_instance`` parameter.
  * Support for calling ``{{ block.super }}``.


0.2.2 (January 10, 2011)
========================

* Updated per
  `comment 3466 on Django Snippet 942 <https://djangosnippets.org/snippets/942/#c3466>`_
  by `eugenyboger <https://djangosnippets.org/users/eugenyboger/>`_
  to fix an issue with nested extends. The specific bug was not reproducible,
  but the additional code shouldn't hurt.


0.2.1 (August 27, 2010)
=======================

* Updated per
  `comment 3237 on Django Snippet 942 <https://djangosnippets.org/snippets/942/#c3237>`_
  by `chadselph <https://djangosnippets.org/users/chadselph/>`_
  to remove a pointless render. The specific bug was not reproducible, but the
  removed code was extraneous.


0.2 (August 4, 2008)
====================

* Updated version from
  `Django Snippet 942 <https://djangosnippets.org/snippets/942/>`_ by
  `zbyte64 <https://djangosnippets.org/users/zbyte64/>`_.
* Improves include:

  1. Simpler/better handling of "extends" block tag
  2. Searches If/Else blocks
  3. Less code
  4. Allow list of templates to be passed which is closer to the behavior of
     ``render_to_response``


0.1 (May 22, 2008)
==================

* Initial version from
  `Django Snippet 769 <https://djangosnippets.org/snippets/769/>`_ by
  `sciyoshi <https://djangosnippets.org/users/sciyoshi/>`_.
* Support Django 0.96.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/clokep/django-render-block",
    "name": "django-render-block",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "[django, template, block, templates, render, context]",
    "author": "Patrick Cloke",
    "author_email": "clokep@patrick.cloke.us",
    "download_url": "https://files.pythonhosted.org/packages/5c/c1/4422e64e9cf25dc5025625605706de5fe44fcef87253fe0067f526bd0d7b/django_render_block-0.10.tar.gz",
    "platform": null,
    "description": "Django Render Block\n###################\n\n.. image:: https://img.shields.io/pypi/v/django-render-block.svg\n    :target: https://pypi.org/project/django-render-block/\n\n.. image:: https://github.com/clokep/django-render-block/actions/workflows/main.yml/badge.svg\n    :target: https://github.com/clokep/django-render-block/actions/workflows/main.yml\n\nRender the content of a specific block tag from a Django template. Works for\narbitrary template inheritance, even if a block is defined in the child template\nbut not in the parent. Generally it works like ``render_to_string`` from Django,\nbut allows you to specify a block to render.\n\nFeatures\n========\n\n*   Render a specific block from a template\n*   Fully supports the Django templating engine\n*   Partially supports the `Jinja2 <http://jinja.pocoo.org/>`__ engine: it does\n    not currently process the ``extends`` tag.\n\nRequirements\n============\n\nDjango Render Block supports Django 4.2, 5.0, and 5.1 on Python 3.8, 3.9, 3.10,\n3.11 and 3.12 (see the Django documentation for which versions of Python are\nsupported by particular Django versions).\n\nExamples\n========\n\nIn ``test1.html``:\n\n.. code-block:: jinja\n\n    {% block block1 %}block1 from test1{% endblock %}\n    {% block block2 %}block2 from test1{% endblock %}\n\nIn ``test2.html``:\n\n.. code-block:: jinja\n\n    {% extends 'test1.html' %}\n    {% block block1 %}block1 from test2{% endblock %}\n\nAnd from the Python shell:\n\n.. code-block:: python\n\n    >>> from render_block import render_block_to_string\n    >>> print(render_block_to_string('test2.html', 'block1'))\n    'block1 from test2'\n    >>> print(render_block_to_string('test2.html', 'block2'))\n    'block2 from test1'\n\nIt can also accept a context as a ``dict`` (just like ``render_to_string``), in\n``test3.html``:\n\n.. code-block:: jinja\n\n    {% block block3 %}Render this {{ variable }}!{% endblock %}\n\nAnd from Python:\n\n.. code-block:: python\n\n    >>> print(render_block_to_string('test3.html', 'block3', {'variable': 'test'}))\n    'Render this test!'\n\nAPI Reference\n=============\n\nThe API is simple and attempts to mirror the built-in ``render_to_string`` API.\n\n``render_block_to_string(template_name, block_name, context=None, request=None)``\n\n    ``template_name``\n        The name of the template to load and render. If it\u2019s a list of template\n        names, Django uses ``select_template()`` instead of ``get_template()``\n        to find the template.\n\n    ``block_name``\n        The name of the block to render from the above template.\n\n    ``context``\n        A ``dict`` to be used as the template\u2019s context for rendering. A ``Context``\n        object can be provided for Django templates.\n\n        ``context`` is optional. If not provided, an empty context will be used.\n\n    ``request``\n        The request object used to render the template.\n\n        ``request`` is optional and works only for Django templates. If both context and request\n        are provided, a ``RequestContext`` will be used instead of a ``Context``.\n\nExceptions\n----------\n\nLike ``render_to_string`` this will raise the following exceptions:\n\n    ``TemplateDoesNotExists``\n        Raised if the template(s) specified by ``template_name`` cannot be\n        loaded.\n\n    ``TemplateSyntaxError``\n        Raised if the loaded template contains invalid syntax.\n\nThere are also two additional errors that can be raised:\n\n    ``BlockNotFound``\n        Raised if the block given by ``block_name`` does not exist in the\n        template.\n\n    ``UnsupportedEngine``\n        Raised if a template backend besides the Django backend is used.\n\nContributing\n============\n\nIf you find a bug or have an idea for an improvement to Django Render Block,\nplease\n`file an issue <https://github.com/clokep/django-render-block/issues/new>`_ or\nprovide a pull request! Check the\n`list of issues <https://github.com/clokep/django-render-block/issues/>`_ for\nideas of what to work on.\n\nAttribution\n===========\n\nThis is based on a few sources:\n\n* Originally `Django Snippet 769 <https://djangosnippets.org/snippets/769/>`__\n* Updated version `Django Snippet 942 <https://djangosnippets.org/snippets/942/>`__\n* A version of the snippets was ported as `Django-Block-Render <https://github.com/uniphil/Django-Block-Render/>`_\n* Additionally inspired by part of `django-templated-email <https://github.com/BradWhittington/django-templated-email/blob/master/templated_email/utils.py>`_\n* Also based on a `StackOverflow answer 2687173 <http://stackoverflow.com/questions/2687173/django-how-can-i-get-a-block-from-a-template>`_\n\n.. :changelog:\n\nChangelog\n#########\n\n0.10 (July 15, 2024)\n====================\n\nNo changes from 0.10b1.\n\n\n0.10b1 (July 1, 2024)\n=====================\n\nBugfixes\n--------\n\n* Fixes exception propagation when rendering templates. Contributed\n  by `@yaakovLowenstein <https://github.com/yaakovLowenstein>`_. (`#52 <https://github.com/clokep/django-render-block/pull/52>`_)\n* Fix rendering blocks over multiple extended templates. (`#56 <https://github.com/clokep/django-render-block/pull/56>`_)\n\nMaintenance\n-----------\n\n* Support Python 3.11 and 3.12. (`#44 <https://github.com/clokep/django-render-block/pull/44>`_,\n  `#55 <https://github.com/clokep/django-render-block/pull/55>`_)\n* Drop support for Python 3.7. (`#44 <https://github.com/clokep/django-render-block/pull/44>`_)\n* Support Django 4.2, 5.0 and 5.1. (`#44 <https://github.com/clokep/django-render-block/pull/44>`_,\n  `#55 <https://github.com/clokep/django-render-block/pull/55>`_)\n* Drop support for Django < 3.2; Django 4.0; Django 4.1. (`#44 <https://github.com/clokep/django-render-block/pull/44>`_,\n  `#55 <https://github.com/clokep/django-render-block/pull/55>`_)\n* Add type hints and configure mypy. (`#54 <https://github.com/clokep/django-render-block/pull/54>`_)\n\n\n0.9.2 (October 18, 2022)\n========================\n\nMaintenance\n-----------\n\n* Drop support for Python 3.6. (`#36 <https://github.com/clokep/django-render-block/pull/36>`_)\n* Improve package metadata. (`#37 <https://github.com/clokep/django-render-block/pull/37>`_)\n* Run `black <https://black.readthedocs.io/>`_, `isort <https://pycqa.github.io/isort/>`_,\n  and `flake8 <https://flake8.pycqa.org>`_, and `pyupgrade <https://github.com/asottile/pyupgrade>`_.\n  (`#38 <https://github.com/clokep/django-render-block/pull/38>`_,\n  `#39 <https://github.com/clokep/django-render-block/pull/39>`_)\n* Update to include and run tests for Django 4.1. Contributed by\n  `Jack Linke <https://github.com/jacklinke>`_.\n  (`#41 <https://github.com/clokep/django-render-block/pull/41>`_)\n\n\n0.9.1 (December 15, 2021)\n=========================\n\nMaintenance\n-----------\n\n* Support Python 3.10. (`#33 <https://github.com/clokep/django-render-block/pull/33>`_)\n* Fixed a packaging issue where the generated wheels were empty. Contributed\n  by `@cordery <https://github.com/cordery>`_. (`#35 <https://github.com/clokep/django-render-block/pull/35>`_)\n\n\n0.9 (December 14, 2021)\n=======================\n\nMaintenance\n-----------\n\n* Drop support for Django 3.0. (`#31 <https://github.com/clokep/django-render-block/pull/31>`_)\n* Support Django 3.2 and 4.0. (`#27 <https://github.com/clokep/django-render-block/pull/27>`_,\n  `#31 <https://github.com/clokep/django-render-block/pull/31>`_)\n* Switch continuous integration to GitHub Actions. (`#26 <https://github.com/clokep/django-render-block/pull/26>`_,\n  `#28 <https://github.com/clokep/django-render-block/pull/28>`_)\n* Changed packaging to use setuptools declarative config in ``setup.cfg``.\n  (`#32 <https://github.com/clokep/django-render-block/pull/32>`_)\n\n\n0.8.1 (October 15, 2020)\n========================\n\nBugfixes\n--------\n\n* Fixes a regression in v0.8 where a ``Context`` could not be re-used. Contributed\n  by `@evanbrumley <https://github.com/evanbrumley>`_. (`#25 <https://github.com/clokep/django-render-block/pull/25>`_)\n\n\n0.8 (October 6, 2020)\n=====================\n\nBugfixes\n--------\n\n* ``render_block_to_string`` now forwards the ``Context`` passed as ``context`` parameter.\n  Contributed by `@bblanchon <https://github.com/bblanchon>`_. (`#21 <https://github.com/clokep/django-render-block/pull/21>`_)\n\nMaintenance\n-----------\n\n* Drop support for Python 3.5, support Python 3.9. (`#22 <https://github.com/clokep/django-render-block/pull/22>`_)\n\n\n0.7 (July 13, 2020)\n===================\n\nMaintenance\n-----------\n\n* Drop support for Django < 2.2. (`#18 <https://github.com/clokep/django-render-block/pull/18>`_)\n* Support Django 3.0 and 3.1. (`#18 <https://github.com/clokep/django-render-block/pull/18>`_,\n  `#20 <https://github.com/clokep/django-render-block/pull/20>`_)\n* Drop support for Python 2.7. (`#19 <https://github.com/clokep/django-render-block/pull/19>`_)\n* Support Python 3.8. (`#18 <https://github.com/clokep/django-render-block/pull/18>`_)\n\n\n0.6 (May 8, 2019)\n=================\n\nImprovements\n------------\n\n* ``render_block_to_string`` now optionally accepts a ``request`` parameter.\n  If given, a ``RequestContext`` instead of a ``Context`` is used when\n  rendering with the Django templating engine. Contributed by\n  `@vintage <https://github.com/vintage>`_. (`#15 <https://github.com/clokep/django-render-block/pull/15>`_)\n\nMaintenance\n-----------\n\n* Support Django 1.11, 2.1, and 2.2. (`#9 <https://github.com/clokep/django-render-block/pull/9>`_,\n  `#11 <https://github.com/clokep/django-render-block/pull/11>`_,\n  `#17 <https://github.com/clokep/django-render-block/pull/17>`_)\n* Support Python 2.7, 3.5, 3.6, and 3.7. (`#9 <https://github.com/clokep/django-render-block/pull/9>`_,\n  `#17 <https://github.com/clokep/django-render-block/pull/17>`_)\n* Fix rendering of README on PyPI. Contributed by `@mixxorz <https://github.com/mixxorz>`_.\n  (`#10 <https://github.com/clokep/django-render-block/pull/10>`_)\n\n\n0.5 (September 1, 2016)\n=======================\n\nBugfixes\n--------\n\n* Fixes a major issue with inheriting templates and rendering a block found in\n  the parent template, but overwriting part of it in the child template.\n  (`#8 <https://github.com/clokep/django-render-block/pull/8>`_)\n\n\n0.4 (August 4, 2016)\n====================\n\nImprovements\n------------\n\n* Initial support for using the `Jinja2 <http://jinja.pocoo.org/>`_ templating\n  engine. See README for caveats. (`#3 <https://github.com/clokep/django-render-block/pull/3>`_)\n\nMaintenance\n-----------\n\n* Support Django 1.10. (`#5 <https://github.com/clokep/django-render-block/pull/5>`_)\n* Support Python 3. (`#6 <https://github.com/clokep/django-render-block/pull/6>`_)\n\n\n0.3.1 (June 1, 2016)\n====================\n\nMaintenance\n------------\n\n* Refactoring to make more generic (for potentially supporting multiple\n  templating engines).\n\n\n0.3 (May 27, 2016)\n==================\n\n* Largely rewritten.\n* Support Django 1.8 and 1.9:\n\n  * Guards against different template backends.\n  * Uses internal APIs for each node.\n  * Removed ``context_instance`` parameter.\n  * Support for calling ``{{ block.super }}``.\n\n\n0.2.2 (January 10, 2011)\n========================\n\n* Updated per\n  `comment 3466 on Django Snippet 942 <https://djangosnippets.org/snippets/942/#c3466>`_\n  by `eugenyboger <https://djangosnippets.org/users/eugenyboger/>`_\n  to fix an issue with nested extends. The specific bug was not reproducible,\n  but the additional code shouldn't hurt.\n\n\n0.2.1 (August 27, 2010)\n=======================\n\n* Updated per\n  `comment 3237 on Django Snippet 942 <https://djangosnippets.org/snippets/942/#c3237>`_\n  by `chadselph <https://djangosnippets.org/users/chadselph/>`_\n  to remove a pointless render. The specific bug was not reproducible, but the\n  removed code was extraneous.\n\n\n0.2 (August 4, 2008)\n====================\n\n* Updated version from\n  `Django Snippet 942 <https://djangosnippets.org/snippets/942/>`_ by\n  `zbyte64 <https://djangosnippets.org/users/zbyte64/>`_.\n* Improves include:\n\n  1. Simpler/better handling of \"extends\" block tag\n  2. Searches If/Else blocks\n  3. Less code\n  4. Allow list of templates to be passed which is closer to the behavior of\n     ``render_to_response``\n\n\n0.1 (May 22, 2008)\n==================\n\n* Initial version from\n  `Django Snippet 769 <https://djangosnippets.org/snippets/769/>`_ by\n  `sciyoshi <https://djangosnippets.org/users/sciyoshi/>`_.\n* Support Django 0.96.\n",
    "bugtrack_url": null,
    "license": "ISC",
    "summary": "Render a particular block from a template to a string.",
    "version": "0.10",
    "project_urls": {
        "Documentation": "https://github.com/clokep/django-render-block/blob/main/README.rst",
        "Homepage": "https://github.com/clokep/django-render-block",
        "Release notes": "https://github.com/clokep/django-render-block/blob/main/CHANGELOG.rst",
        "Source": "https://github.com/clokep/django-render-block",
        "Tracker": "https://github.com/clokep/django-render-block/issues"
    },
    "split_keywords": [
        "[django",
        " template",
        " block",
        " templates",
        " render",
        " context]"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9361f4c9599d1a3f3aa88692c97f7ad22040373405fe58c5bf191b52ff637d8c",
                "md5": "537a5f79db89d823e00490579f969662",
                "sha256": "4deeec70a360aa90385443aeae1213ffb2acbfe2b5fb09d4afe47e75a29240c3"
            },
            "downloads": -1,
            "filename": "django_render_block-0.10-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "537a5f79db89d823e00490579f969662",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 8958,
            "upload_time": "2024-07-15T20:33:04",
            "upload_time_iso_8601": "2024-07-15T20:33:04.848276Z",
            "url": "https://files.pythonhosted.org/packages/93/61/f4c9599d1a3f3aa88692c97f7ad22040373405fe58c5bf191b52ff637d8c/django_render_block-0.10-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5cc14422e64e9cf25dc5025625605706de5fe44fcef87253fe0067f526bd0d7b",
                "md5": "ad3418449ead374e1c4f0cd589ee61e5",
                "sha256": "23fbc9cfed17aac47e936e65f0c29ae186765a41234cdc8dbf88d4a9377fdd76"
            },
            "downloads": -1,
            "filename": "django_render_block-0.10.tar.gz",
            "has_sig": false,
            "md5_digest": "ad3418449ead374e1c4f0cd589ee61e5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 10008,
            "upload_time": "2024-07-15T20:33:06",
            "upload_time_iso_8601": "2024-07-15T20:33:06.582167Z",
            "url": "https://files.pythonhosted.org/packages/5c/c1/4422e64e9cf25dc5025625605706de5fe44fcef87253fe0067f526bd0d7b/django_render_block-0.10.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-15 20:33:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "clokep",
    "github_project": "django-render-block",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "tox": true,
    "lcname": "django-render-block"
}
        
Elapsed time: 0.28555s