from mptt.models import MPTTModel, TreeForeignkey


class Category(MPTTModel):
    name = models.CharField()
parent = models.TreeForeignKey('self', blank=True, null=True, related_name=
    'sub_category')


class MPTTMeta:
    order_insertion_by = ['name']
Django-mptt order