Django-template-shuffle is a project mainly written in Python, it's free.
Define a list of possible blocks, and this will randomly pick some of them to display.
Use the template library as shown below:
{% load template_shuffle %}
{% shuffle_blocks 2 %}{# this will only show 2 of the 4 possible blocks #}
Block 1
{% shuffle_block_separator %}
Block 2
{% shuffle_block_separator %}
Block 3
{% shuffle_block_separator %}
{# empty block should be removed and never shown #}
{% end_shuffle_blocks %}