[Django]-Integer out of range


Try using BigIntegerField if you integers are that big. From the documentation:

A 64 bit integer, much like an IntegerField except that it is guaranteed to fit numbers from -9223372036854775808 to 9223372036854775807. The admin represents this as an <input type="text"> (a single-line input).


Try this

Change models.IntegerField() to models.BigIntegerField()

class TableName(models.Model):
    ColumnName= models.BigIntegerField(default=0)


Do not forget to migrate the changes you did, otherwise it will not work

python manage.py migrate

python manage.py makemigrations

Leave a comment