Django

Custom table name in Django model

If you want to overide django default table name convension. Then you can use db_table property inside the Meta class of the django model.

Example:

class User(models.Model):
    name = models.CharField(max_length=200)
    surname = models.CharField(max_length=200)

    class Meta:
        db_table = 'user_table'

Once you migrate the model then django will name the table called user_table.