我创建了一个配置文件模型:这是代码
class NPC_profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
ID = models.CharField(max_length=100)
학번 = models.CharField(max_length=5)
和意见
def signup(request):
if request.method == "POST":
if request.POST["password"] == request.POST["repassword"]:
user = User.objects.create_user(
username=request.POST["username"], password=request.POST["password"])
ID = request.POST["ID"]
학번 = request.POST["학번"]
profile = NPC_profile(user=user, ID=ID, 학번=학번)
profile.save()
auth.login(request, user)
return redirect('list')
return render(request, 'NPC/signup.html')
return render(request, 'NPC/signup.html')
但
appear OperationalError at /NPC/signup/
no such table: NPC_npc_profile
我该如何解决这个错误?