In the readme this example code is given:
print(render_block_to_string('test3.html', 'block3', {'variable': 'test'}))
but the code defines that context is not a dict but Optional[Context] = None:
def render_block_to_string(
template_name: Union[str, Tuple[str], List[str]],
block_name: str,
context: Optional[Context] = None,
request: Optional[HttpRequest] = None,
) -> str:
We could provide a Context object but i don't think that was intended to do :
from django.template import Context
print(render_block_to_string('test3.html', 'block3', Context({'variable': 'test'})))
In the readme this example code is given:
but the code defines that context is not a
dictbutOptional[Context] = None:We could provide a Context object but i don't think that was intended to do :