django-allauth

Multiple user type sign up with django-allauth

二次信任 提交于 2019-11-27 01:43:04
问题 EDIT Please, do not waste your time reading the question... it is the wrong approach! Look at my own answer for a step-by-step guide (with explanation) of the right solution TL;DR How could I implement sign up for private and company users using django-allauth? The approach I'm following (is it correct?) I have the following models : class PrivateUser(models.Model): """Models a private user account""" user = models.OneToOneField(User, on_delete=models.CASCADE) class CompanyUser(models.Model):

How can I get the user's facebook id with django-allauth?

☆樱花仙子☆ 提交于 2019-11-26 19:29:28
问题 I want to display a picture of the current_user in my template. How can I access the user's facebook id when I'm using django-allauth? 回答1: For each user that is signed up via a social account a SocialAccount instance is available. This model has a foreign key to User . Note that a user can connect multiple social networking accounts to his local account, so in practice there may be more than one SocialAccount instances available. How you want to deal with this is project dependent. I can

How to override template in django-allauth?

不想你离开。 提交于 2019-11-26 18:22:04
问题 Answers in other questions leave impression that this is in fact very easy: django-allauth configuration doubts overriding default templates of django-allauth However, I can't get it to work at all. From example app settings I can see that django-allauth supposedly expects it's templates to be in account , openid and socialaccount directories. But when I put template at TEMPLATE_DIR/account/signup.html it doesn't get loaded, signup view displays template bundled with django-allauth. What do I

Log in / Sign up directly on home page

廉价感情. 提交于 2019-11-26 17:16:15
问题 Instead of logging in on page '../account/login/' i would like to make avaliable for users to log directly on home page for example. What should i do to make it possible? How to connect input fields on home page with allauth? I don't know if this is too complicated to make it work in such way? 回答1: There is a solution that works for me. It's not the optimal solution because it's not DRY, so I would be grateful is somebody improves it! Basically what I did is to render the official allauth

How to customize user profile when using django-allauth

一曲冷凌霜 提交于 2019-11-26 03:19:29
问题 I have a django project with the django-allauth app. I need to collect additional data from the user at signup. I came across a similar question here but unfortunately, no one answered the profile customization part. Per the documentation provided for django-allauth: ACCOUNT_SIGNUP_FORM_CLASS (= None ) A string pointing to a custom form class (e.g. ‘myapp.forms.SignupForm’ ) that is used during signup to ask the user for additional input (e.g. newsletter signup, birth date). This class should