order_by django queryset order by ordering

  1. Use order_by method to specify the field to order the queryset by.
  2. Put the field name in the order_by method to indicate the desired ordering.
  3. Use "-" in front of the field name to specify descending ordering.