I am very new to django and was able to finish the tutorial on djangoproject.com without any errors. I am now going through the Django REST framework tutorial found at http:
Initially ,I have commented my new fields which is causing those errors, and run python manage.py makemigrations and then python manage.py migrate to actually delete those new fields.
class FootballScore(models.Model):
team = models.ForeignKey(Team, related_name='teams_football', on_delete=models.CASCADE)
# match_played = models.IntegerField(default='0')
# lose = models.IntegerField(default='0')
win = models.IntegerField(default='0')
# points = models.IntegerField(default='0')
class FootballScore(models.Model):
team = models.ForeignKey(Team, related_name='teams_football', on_delete=models.CASCADE)
match_played = models.IntegerField(default='0')
lose = models.IntegerField(default='0')
win = models.IntegerField(default='0')
points = models.IntegerField(default='0')
Then i freshly uncommented them and run python manage.py makemigrations and python manage.py migrate and boom. It worked for me. :)