django-authentication

Can't login with normal user account in django

吃可爱长大的小学妹 提交于 2021-01-07 02:42:46
问题 I'm working on an app where I have a personalized User model. I can use the superuser to login, but when I try with a normal user I get an error of wrong password and user name. When I look at the data of the user, I find that the password of normal users isn't hashed. The models definition models.py : from django.db import models from django.contrib.gis.db import models from phonenumber_field.modelfields import PhoneNumberField from django.contrib.gis.db import models as gis_models from

Django password reset. Not sending mail

两盒软妹~` 提交于 2020-12-04 19:34:16
问题 I'm trying to get the django password reset working but the reset email does not get sent. I know my email is properly configured because the following works both in the shell and in one of my views (I'm using it to get support email to myself). from django.core.mail import send_mail send_mail('Subject here', 'Here is the message.', 'admin@mydomain.com',['me@gmail.com'], fail_silently=False) I can get to my reset password view ( password/reset/ ) and after I give it my email it correctly

Django password reset. Not sending mail

非 Y 不嫁゛ 提交于 2020-12-04 19:34:14
问题 I'm trying to get the django password reset working but the reset email does not get sent. I know my email is properly configured because the following works both in the shell and in one of my views (I'm using it to get support email to myself). from django.core.mail import send_mail send_mail('Subject here', 'Here is the message.', 'admin@mydomain.com',['me@gmail.com'], fail_silently=False) I can get to my reset password view ( password/reset/ ) and after I give it my email it correctly

Django password reset. Not sending mail

你离开我真会死。 提交于 2020-12-04 19:32:52
问题 I'm trying to get the django password reset working but the reset email does not get sent. I know my email is properly configured because the following works both in the shell and in one of my views (I'm using it to get support email to myself). from django.core.mail import send_mail send_mail('Subject here', 'Here is the message.', 'admin@mydomain.com',['me@gmail.com'], fail_silently=False) I can get to my reset password view ( password/reset/ ) and after I give it my email it correctly

In Django admin, how to filter users by group?

筅森魡賤 提交于 2020-12-01 10:41:53
问题 It gives you filter by staff status and superuser status, but what about groups? 回答1: Since version 1.3 it can be done using this: list_filter = ('groups__name') Of course as @S.Lott explains you must register your customized class in the admin.py file: from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User class MyUserAdmin(UserAdmin): list_filter = UserAdmin.list_filter + ('groups__name',) admin.site.unregister(User)

In Django admin, how to filter users by group?

半城伤御伤魂 提交于 2020-12-01 10:41:25
问题 It gives you filter by staff status and superuser status, but what about groups? 回答1: Since version 1.3 it can be done using this: list_filter = ('groups__name') Of course as @S.Lott explains you must register your customized class in the admin.py file: from django.contrib import admin from django.contrib.auth.admin import UserAdmin from django.contrib.auth.models import User class MyUserAdmin(UserAdmin): list_filter = UserAdmin.list_filter + ('groups__name',) admin.site.unregister(User)