Django Tip: Outputting list of items separated by commas, but only if it has more than one item
How many times do you need to do this? You have a list of things to output. The list can be empty, has one element, or more. You want to separate each items with a separator for readability. What do you do?
1. The simple but not reader friendly way:
toppings = [ ‘cheese’,’tomatos’,’pineapple’ ]
or toppings = […]