[Fixed]-ChoiceField: Select a valid choice. That is not one of the available choices

29👍

You have set datatype as Integer

gender = models.**IntegerField**(choices=CHOICE_GENDER)

and your choices are given in String

CHOICE_GENDER = (('1', 'Male'), ('2', 'Female'))

Instead of ‘1’ it should be 1

CHOICE_GENDER = ((1, 'Male'), (2, 'Female'))

Leave a comment