1๐
i would render all images to frontend and slide with jquery.
something like: (you need to adjust variables names accordingly, these are almost pseudo ones)
{% for im in all_images %}
<img src="im.url" id="im_{{ forloop.counter }}" />
{% endfor %}
jquery:
var random_im_id = Math.floor(Math.random() * 3) + 1; // random number between 1 - 3
var background_image = 'url(' + $('#im_' + random_im_id).attr('src') + ')';
$('body').css('background-image', background_image);
๐คdoniyor
Source:stackexchange.com