[Django]-Django foreign key model is not saving reference

7👍

Here

up.user = u
u.save()

You are not saving the up anywhere.

So u.save() should be up.save()

u.save()
up.user = u
up.save()

Leave a comment