Your work is perfect, but please i have an issue, after following your intructions to 3minuites 35 seconds and i try to run the project it shows me this error: NameError: name 'AccountAdmin' is not defined. please how do i fix this issue
while fiddling around with def __str__(self): method, I can't seem to get the username to display, I've looked over the video a lot, but can only display the email. I did the same as Mitch did (return self.email + ", " + self.username)
When I'm customizing the user admin and trying to add a user using my website admin, it won't show me the email field. I've done the exact same steps that you did. I'm stuck on this problem for two days now, tried clearing migrations, made sure the USERNAME_FIELD is set to 'email' and still don't know what to do. It's driving me crazy
Django documentations says: docs.djangoproject.com/en/3.1/topics/auth/customizing/#custom-users-and-the-built-in-auth-forms Some built-in forms such as AuthenticationForm, SetPasswordForm, PasswordChangeForm, AdminPasswordChangeForm are compatible with any subclass of AbstractBaseUser, whereas others, including UserCreationForm, UserChangeForm are tied to built-in User model and need to be rewritten or extended to work with a custom user model. The documentation gives an example on how to rewrite the UserCreationForm and UserChangeForm in the UserAdmin. docs.djangoproject.com/en/3.1/topics/auth/customizing/#a-full-example
django.core.exceptions.FieldError: Unknown field(s) (username) specified for Account. Check fields/fieldsets/exclude attributes of class AccountAdmin. help
Okay - maybe django - maybe another library updated but now I get RuntimeError: Model class src.account.models.Account doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS. I spect some time to try and figure it out but cant find answer I even copied the GitHub code to make sure I have no typo's Can you guide me please
Hi, i did everything like you did except username I used user_name instead all worked perfect till here. but when I added admin.site.register(Account,AccountAdmin) i get this error class 'account.admin.AccountAdmin'>: (admin.E033) The value of 'ordering[0]' refers to 'username', which is not an attribute of 'account.Account'. i also copied the source code (changed only username to user_name) and received the same error if i delete AccountAdmin and register like this admin.site.register(Account) it works like up to previous chapter can you help? Thanks
Yeah, I also had this problem but I found the solution for it. Add this line of code in admin.py "ordering = ()" same as "list_filter = ()". That should solve the error.
FieldError at /admin/account/account/2/change/ Unknown field(s) (user_permissions, first_name, last_name, groups) specified for Account. Check fields/fieldsets/exclude attributes of class AccountAdmin.
Can someone help? I followed the code exactly as I do not have a basis on classes,objects and instances in python. What do I change? AttributeError at / type object 'Account' has no attribute 'objects' Request Method: GET Request URL: 127.0.0.1:8000/ Django Version: 3.0.7 Exception Type: AttributeError Exception Value: type object 'Account' has no attribute 'objects' Exception Location: C:\Users\Surface\Desktop\ECOMMERCE\src\personal\views.py in home_screen_view, line 6 Python Executable: C:\Users\Surface\Desktop\ECOMMERCE\src\venv\Scripts\python.exe
it's saying you don't have objects in Account. because we are using a custom account class we had to put objects = MyAccountManager() . make sure you spelled objects right.
i love your videos. your awesome dude, but my only question is why are you using the views.py inside the personal folder to pass variables for the account app. Aren't they 2 separate apps ?, plus doesn't account already have its own views.py
django.core.exceptions.FieldError: Unknown field(s) (username) specified for Account. Check fields/fieldsets/exclude attributes of class AccountAdmin. help
Its APPEARS AFTER I CLICK ADD ACCOUNT ...how to resolve i dont understand.....help mitch django.core.exceptions.FieldError: Unknown field(s) (username) specified for Account. Check fields/fieldsets/exclude attributes of class AccountAdmin.
hey you are awesome!!!
i almost spent a week learning django but i wasn't able to find such a good tutorial for it
thank you so muuch!!!
Really appreciate the way you explain. Love to see some django rest with reactjs🥰🥰
I like your honesty
Excellent explanation
Your work is perfect, but please i have an issue, after following your intructions to 3minuites 35 seconds and i try to run the project it shows me this error: NameError: name 'AccountAdmin' is not defined. please how do i fix this issue
while fiddling around with def __str__(self): method, I can't seem to get the username to display, I've looked over the video a lot, but can only display the email. I did the same as Mitch did (return self.email + ", " + self.username)
I did exactly same as what you did, but I cannot email field in the form while creating a user manually from the admin panel, why is that ?
Great job, thanks
when i get all accounts i get an error that Account doesn have objects atribute
When I'm customizing the user admin and trying to add a user using my website admin, it won't show me the email field. I've done the exact same steps that you did. I'm stuck on this problem for two days now, tried clearing migrations, made sure the USERNAME_FIELD is set to 'email' and still don't know what to do. It's driving me crazy
Django documentations says:
docs.djangoproject.com/en/3.1/topics/auth/customizing/#custom-users-and-the-built-in-auth-forms
Some built-in forms such as AuthenticationForm, SetPasswordForm, PasswordChangeForm, AdminPasswordChangeForm are compatible with any subclass of AbstractBaseUser, whereas others, including UserCreationForm, UserChangeForm are tied to built-in User model and need to be rewritten or extended to work with a custom user model.
The documentation gives an example on how to rewrite the UserCreationForm and UserChangeForm in the UserAdmin.
docs.djangoproject.com/en/3.1/topics/auth/customizing/#a-full-example
@@jniyomufasha thanks man
@Mitch how can we do the search based on the property of the Model class
django.core.exceptions.FieldError: Unknown field(s) (username) specified for Account. Check fields/fieldsets/exclude attributes of class AccountAdmin.
help
Okay - maybe django - maybe another library updated but now I get
RuntimeError: Model class src.account.models.Account doesn't declare an explicit app_label and isn't in an application in INSTALLED_APPS.
I spect some time to try and figure it out but cant find answer
I even copied the GitHub code to make sure I have no typo's
Can you guide me please
Hi, i did everything like you did except username I used user_name instead all worked perfect till here.
but when I added admin.site.register(Account,AccountAdmin) i get this error
class 'account.admin.AccountAdmin'>: (admin.E033) The value of 'ordering[0]' refers to 'username', which is not an attribute of 'account.Account'.
i also copied the source code (changed only username to user_name) and received the same error
if i delete AccountAdmin and register like this admin.site.register(Account) it works like up to previous chapter
can you help?
Thanks
Yeah, I also had this problem but I found the solution for it. Add this line of code in admin.py "ordering = ()" same as "list_filter = ()". That should solve the error.
@@moonshrine6703 ohhh, dude thank you so much )
Thanks!
The password is not hidden for me, what do i do?
FieldError at /admin/account/account/2/change/
Unknown field(s) (user_permissions, first_name, last_name, groups) specified for Account. Check fields/fieldsets/exclude attributes of class AccountAdmin.
Me too. Have you figured out the issue yet?
@@CosmicNomadis22 add fieldsets = () in class AccountAdmin in admin.py file. u wont get that error
@@Rajeshkushi thanks mate!👍🏾
@@Rajeshkushi loveeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee u man...My life stuck here for 1 hour you saved me...thank you
Hi, how create useradmin?
python manage.py createsuperuser
Can someone help? I followed the code exactly as I do not have a basis on classes,objects and instances in python. What do I change?
AttributeError at /
type object 'Account' has no attribute 'objects'
Request Method: GET
Request URL: 127.0.0.1:8000/
Django Version: 3.0.7
Exception Type: AttributeError
Exception Value:
type object 'Account' has no attribute 'objects'
Exception Location: C:\Users\Surface\Desktop\ECOMMERCE\src\personal\views.py in home_screen_view, line 6
Python Executable: C:\Users\Surface\Desktop\ECOMMERCE\src\venv\Scripts\python.exe
it's saying you don't have objects in Account. because we are using a custom account class we had to put objects = MyAccountManager()
. make sure you spelled objects right.
@@fruitlover7073 OMG wow. Was stuck for a long time on that. Alright thankyou so much. Appreciate the help
Still the password is not hashing :(
codinginflow was searched xD
duh. Where else am I gunna learn android stuff?
@@codingwithmitch that's true
Both of you are quite good at teaching much better than what I get in my college xD
@@savin1999 nice to hear that 😁.
Want to do something for me?
Leave a testimonial here: codingwithmitch.com/testimonials
@@codingwithmitch hey i have left a testimonial !
@@savin1999 thanks you the best
i love your videos. your awesome dude, but my only question is why are you using the views.py inside the personal folder to pass variables for the account app. Aren't they 2 separate apps ?, plus doesn't account already have its own views.py
django.core.exceptions.FieldError: Unknown field(s) (username) specified for Account. Check fields/fieldsets/exclude attributes of class AccountAdmin.
help
Its APPEARS AFTER I CLICK ADD ACCOUNT ...how to resolve i dont understand.....help mitch
django.core.exceptions.FieldError: Unknown field(s) (username) specified for Account. Check fields/fieldsets/exclude attributes of class AccountAdmin.