django-allauth

How to populate user profile with django-allauth provider information?

守給你的承諾、 提交于 2019-11-28 17:39:10
I'm using django-allauth for my authentication system. I need that when the user sign in, the profile module get populated with the provider info (in my case facebook). I'm trying to use the pre_social_login signal, but I just don't know how to retrieve the data from the provider auth from django.dispatch import receiver from allauth.socialaccount.signals import pre_social_login @receiver(pre_social_login) def populate_profile(sender, **kwargs): u = UserProfile( >>FACEBOOK_DATA<< ) u.save() Thanks!!! The pre_social_login signal is sent after a user successfully authenticates via a social

django-allauth: Linking multiple social accounts to a single user

泄露秘密 提交于 2019-11-28 16:54:48
In testing django-allauth, if I log in and log out with different social accounts, they don't seem to be linked together (in that I cannot access them by looking at socialaccount_set.all.0, socialaccount_set.all.1, etc). Can someone explain how to link social accounts together? I did see this post: how do i connect multiple social auth providers to the same django user using django-allauth? which seems to put the onus on the user to log in first with one social account, and then link the other accounts for himself. Certainly there should be a way to do this without putting the onus on the user

Debugging django-allauth Social Network Login Failure

做~自己de王妃 提交于 2019-11-28 12:42:08
When using django-allauth to do an OAuth login via a social provider, sometimes it fails with the error page "Social Network Login Failure". There is no log output containing more information. There is a feature request for this log output ( https://github.com/pennersr/django-allauth/issues/1120 ) but it has been open for over a year. In the mean time, how do I get more information to debug this error? More information is passed to the context used to render the error template but is not used in the default template. You can get log output by overriding the template and including in your

Debugging AllAuth: social account not logging user in despite connecting successfully

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-28 08:25:15
问题 Clicking the facebook login button in the login form correctly brings up the fb login popup, but after entering credentials the pop-up closes and nothing happens. Clicking the button again without reloading the pages confirms that the fb account is connected as browser console prints: FB.login() called when user is already connected. However no new entries appear in the user database, the user isn't redirected and is not signed in. So the problem appears to be with how AllAuth is handling

Multiple user type sign up with django-allauth

痴心易碎 提交于 2019-11-28 07:06:11
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): """Models the company's contact person user account""" user = models.OneToOneField(User, on_delete

Django AllAuth - How to manually send a reset-password email?

六眼飞鱼酱① 提交于 2019-11-28 04:39:49
问题 In my application I am using Django Allauth. I don't have any registration form for users. The admin is going to register users by uploading an excel file that contains user info. I have done all of this and users are saved in the user table by auto generating passwords. After I upload user lists and save them in database, I want to send a reset password email to each user. In allauth to reset password you first need to go to reset page account/password/reset/ and type your email. then an

Django allauth social login: automatically linking social site profiles using the registered email

 ̄綄美尐妖づ 提交于 2019-11-28 03:02:21
I aim to create the easiest login experience possible for the users of my Django site. I imagine something like: Login screen is presented to user User selects to login with Facebook or Google User enter password in external site User can interact with my site as an authenticated user Ok, this part is easy, just have to install django-allauth and configure it. But I also want to give the option to use the site with a local user. It would have another step: Login screen is presented to user User selects to register User enter credentials Site sends a verification email User clicks in email link

django allauth login & signup form on homepage

强颜欢笑 提交于 2019-11-28 01:47:24
问题 I have been looking for a solution for some time now and I am not able to wrap my head around this. All I am trying to accomplish is to have the allauth login and signup form on the same page and on the homepage instead of under the /accounts urls. Does anyone have experience with that or has a solution they could share or point me in the right direction? Any help would be appreciated. 回答1: First we take create a custom view using allauth's signup view from allauth.accounts.views import

Saving custom user model with django-allauth

余生颓废 提交于 2019-11-28 00:58:03
问题 I have django custom user model MyUser with one extra field: # models.py from django.contrib.auth.models import AbstractUser class MyUser(AbstractUser): age = models.PositiveIntegerField(_("age")) # settings.py AUTH_USER_MODEL = "web.MyUser" I also have according to these instructions custom all-auth Signup form class: # forms.py class SignupForm(forms.Form): first_name = forms.CharField(max_length=30) last_name = forms.CharField(max_length=30) age = forms.IntegerField(max_value=100) class

Django: SocialApp matching query does not exist

心已入冬 提交于 2019-11-27 20:31:30
问题 I am facing a problem in django-allauth . I configured localhost:9000/admin/ with following details socialapp . provider: Name: Client id: App ID, or consumer key Key: Secret: etc . I set the SITE_ID = 2 (Because I changed the default site example.com to localhost:9000) In setting.py INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', 'uni