ValueError at /feedback/by/feedback/new Cannot assign "<User: feedback>": "Feedback.user" must be a "User" instance.

82 views
Skip to first unread message

Saloni Kalra

unread,
Jun 23, 2018, 9:56:23 AM6/23/18
to django...@googlegroups.com
This is a feedback application for teachers by the students. I have been constntly getting the following error:
ValueError at /feedback/by/feedback/new
Cannot assign "<User: feedback>": "Feedback.user" must be a "User" instance.
Please help.
Thanks.

Melvyn Sopacua

unread,
Jun 23, 2018, 2:25:25 PM6/23/18
to django...@googlegroups.com

You're using a custom user model, but have not set AUTH_USER_MODEL.

 

--

Melvyn Sopacua

Saloni Kalra

unread,
Jun 23, 2018, 3:10:27 PM6/23/18
to Django users
Thank you for your reply. I removes all the migrations and dropped the database. Now when I try to make migrations i get the following error in my terminal.
Thanks and regards,
Saloni

Error:
accounts.User.user_ptr: (fields.E301) Field defines a relation with the model 'auth.User', which has been swapped out.
        HINT: Update the relation to point at 'settings.AUTH_USER_MODEL'.

Melvyn Sopacua

unread,
Jun 24, 2018, 9:26:36 AM6/24/18
to django...@googlegroups.com
On zaterdag 23 juni 2018 21:10:27 CEST Saloni Kalra wrote:
> Thank you for your reply. I removes all the migrations and dropped the
> database. Now when I try to make migrations i get the following error in my
> terminal.
> Thanks and regards,
> Saloni
>
> *Error:*
> accounts.User.user_ptr: (fields.E301) Field defines a relation with the
> model 'auth.User', which has been swapped out.
> HINT: Update the relation to point at 'settings.AUTH_USER_MODEL'.

I suggest you read and understand this entire section:
https://docs.djangoproject.com/en/2.0/topics/auth/customizing/#auth-custom-user


--
Melvyn Sopacua

Saloni Kalra

unread,
Jun 24, 2018, 9:28:26 AM6/24/18
to django...@googlegroups.com
Alright! Thanks much!

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5782852.cBHu3mGn29%40fritzbook.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages