When django-registration doesn't support django 1.5 and custom user model. I'm trying use django-allauth, from first look it's great product.
Problem i have - username field required, but in my app i don't have username's. So, allauth documentation says:
**Available settings:** ACCOUNT_AUTHENTICATION_METHOD (="username" | "email" | "username_email")
Specifies the login method to use -- whether the user logs in by entering his username, e-mail address, or either one of both.
Ok, i done, and got error:
AssertionError at /accounts/signup/ No exception supplied
models.py:
class MyUser(AbstractBaseUser, PermissionsMixin): title = models.CharField ('Name', max_length=100) email = models.EmailField('Email', max_length=255, unique=True) ...
settings.py
ACCOUNT_USERNAME_REQUIRED = False ACCOUNT_AUTHENTICATION_METHOD = ('email') AUTH_USER_MODEL = 'internboard.MyUser'
What i'm doing wrong ?
Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication.
If you want to use django's default authentication backend you cannot make username non unique. You will have to implement a class with get_user(user_id) and authenticate(request, **credentials) methods for a custom backend.
Thanks, i found, right settings for my task:
ACCOUNT_AUTHENTICATION_METHOD = 'email' ACCOUNT_EMAIL_REQUIRED = True ACCOUNT_UNIQUE_EMAIL = True ACCOUNT_USERNAME_REQUIRED = False
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With