techwithtim/Music-Controller-Web-App-Tutorial

Room Code Not Generate Automatically

DebkantaMondal opened this issue · 2 comments

It shows 200 Error Code and that is for already exists the queryset when i create a room and post from backend link .

When I goto create-room url it looks like that :
Screenshot (19)

After Create Room from backend it generates host key but not Room Code :
Screenshot (18)

Please Solve this bug and help me to solve it as I follow this repo as my guide to build react-django app .

Compare your models.py and views.py with Tim's code. I'm sure you've missed adding something in the middle.

In earlier videos, he forgot to change the default param in for code in Room class with generate_unique_code function that he created above to generate random codes.
code = models.CharField(max_length = 8,default=generate_unique_code,unique=True)