If you use pagination rather than a Javascript table sorter, it might not be sufficient or behave unexpected.
Create every column header as a link e.g.
Name |
and in your view you check whether the order_by
parameter is set or not:
order_by = request.GET.get('order_by', 'defaultOrderField')
Model.objects.all().order_by(order_by)