django-allauth

decide where to go to after connecting with django-allauth

巧了我就是萌 提交于 2019-11-27 18:51:59
问题 After connecting an account with a social app using django-allauth the user is redirected to accounts/social/connections . How can I change this behavior? 回答1: If the user is adding more social accounts to his existing (local) account, then the most logical default would be indeed to redirect to the social account connections management screen. However, you can easily override the default by passing along a next parameter. Have a look here: https://github.com/pennersr/django-allauth/blob

django-allauth: Only allow users from a specific google apps domain

狂风中的少年 提交于 2019-11-27 18:40:12
问题 I am a newbie at Django. Using django-allauth I have set up single click sign in. I obtained my domain credentials ( client_id and secret_key) from google api console. But the problem is django-allauth is letting me login from any google account while I want the email addresses to be restricted to my domain ( @example.com instead of @gmail.com) django-social-auth has the white listed domains parameter for this, how do I include this information in allauth? I found django-allauth much easier

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

☆樱花仙子☆ 提交于 2019-11-27 18:25:26
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? 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 imagine one would want to copy the profile image locally, or perhaps you would want to give preference to the

Log in / Sign up directly on home page

女生的网名这么多〃 提交于 2019-11-27 15:43:10
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? 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 login template and copy the HTML code of the form. Then I changed the csrf token and the urls and pasted it to

django-allauth: how to modify email confirmation url?

最后都变了- 提交于 2019-11-27 14:07:56
问题 I'm running django on port 8001, while nginx is handling webserver duties on port 80. nginx proxies views and some REST api calls to Django. I'm using django-allauth for user registration/authentication. When a new user registers, django-allauth sends the user an email with a link to click. Because django is running on port 8001, the link looks like http://machine-hostname:8001/accounts/confirm-email/xxxxxxxxxxxxxx How can I make the url look like http://www.example.com/accounts/confirm-email

How to override template in django-allauth?

痴心易碎 提交于 2019-11-27 14:05:32
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 miss? I eventually resorted to loading my app before django-allauth. In settings.py : INSTALLED_APPS =

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

烂漫一生 提交于 2019-11-27 10:36:47
问题 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()

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

北城以北 提交于 2019-11-27 10:02:21
问题 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

Debugging django-allauth Social Network Login Failure

爱⌒轻易说出口 提交于 2019-11-27 07:10:46
问题 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? 回答1: More information is passed to the context used to render the error template but is not

overriding default templates of django-allauth

依然范特西╮ 提交于 2019-11-27 01:47:25
问题 I used this social registration/signup library django allauth for a project of mine. How do i customize the default templates and forms to give a better look and feel? 回答1: the latest version of all-auth on github has its templates outside, however the one on Pypi is not, all you need to do is clone the repo in your project directory and override the templates. As simple as that. 回答2: Assuming you have set a project level templates directory using the TEMPLATE_DIRS setting like: TEMPLATE_DIRS