<p>Django templates has a built-in complex tag that regroups a list of alike objects by a common attribute called <em>regroup.</em> You can use the <em><code>{% regroup %}</code></em> tag to group the list of cities by country: </p>
By clicking “Accept all”, you agree to the storing of cookies on your device to enhance site navigation, analyze site usage and assist in our marketing efforts. Check our privacy policies.