[Answer]-Django how to assign a User foreign key id within view

1👍

You just assign this only not id,

c.author=request.user
👤dhana

0👍

For assigning user, it should be like:

c.author= User.objects.filter(id= request.user.id)[0]
👤ruddra

Leave a comment