Monday, May 24, 2021

Re: In need of immediate help from Django community

Thank you for your response. It worked out perfectly.

On Tue, 25 May, 2021, 4:39 am Kelvin Sajere, <kells4real@gmail.com> wrote:
Import the User model in your forms.py and use it instead of Profile. As the error clearly states, the Profile model does not have a username field. Django actually recommends using the AbstractUser, or the AbstractBaseUser to extend the default User model if you wish to create something like a profile. 

On Mon, May 24, 2021 at 9:31 PM Omkar Parab <omkar211196@gmail.com> wrote:
Error is in forms.py file. 

"model = User" not profile.

Default "User" model comes with username, email filed.

Why you're creating another email field in the Profile model?

Just fetch it using {{ user.email }} 


On Tue, May 25, 2021, 1:38 AM Aritra Ray <aritra805@gmail.com> wrote:
Hi,

I've been facing a problem recently in creating a Django Profile model for an E-commerce website.
Error: FieldError(message) django.core.exceptions.FieldError: Unknown field(s) (username) specified for Profile
Kindly help me out if possible. The screenshots have been attached below and the github link for the project has been provided.

Link: https://github.com/First-project-01/Django-ecommerce (Check out the 'changes' branch)

Regards,
Aritra

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFecadvxBCa6w02%3DZ887%2BnaEdY-R6B9%2BVVFzVW5zYvkt1gA2hg%40mail.gmail.com.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAJY8mfzFT-GqqZ0YvdLKH9gKcTAv%2B1srG9973pXYfA5f_qVA7w%40mail.gmail.com.


--
KeLLs

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CADYqDX1dm1Y-T89W9%3DyZQs1bH04eNUj5qcCpwieOSDoY%2BDy9Kg%40mail.gmail.com.

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAFecadt6r70L7v78%3Dy63MfyNdFLYJwfKJaP2BeuxO-%3Dgp9fmMg%40mail.gmail.com.

No comments:

Post a Comment