Skip to content Skip to sidebar Skip to footer

Get_user_model Doesn't Return A Value

as my first project in Django I am creating a todo app, that lets people log in and see their own tasks that they created. For that, I need to save author info in single task data.

Solution 1:

Your form template only includes the title field, you either need to add the added_by field to this form, or add it in the view handling

{{ form.added_by }}

or

if request.method == 'POST':
    form = TaskForm({**request.POST, **{"added_by": request.user}})

Post a Comment for "Get_user_model Doesn't Return A Value"