django-allauth

django django-allauth save extra_data from social login in signal

被刻印的时光 ゝ 提交于 2020-01-11 12:11:07
问题 Setup I'm using Django 1.8.15 and django-allauth 0.28.0 Description What I want to do is pretty easy to explain: If a user logs in via social media (facebook, google+ or twitter) i want to retrieve the extra_data from sociallogin to get the url to the avatar and other information to store it in my Profile , which is a One-to-one relation to my User model. My approaches 1) First I added a class with pre_social_login like here which gets called after the user has signed in via social media.

How to get redirected to a popup after Facebook login

孤街浪徒 提交于 2020-01-07 02:44:13
问题 on my django app, I have a Facebook connect button (via django allauth). When I click that, the facebook dialog box appears. Now, i want that after login, the user is redirected to a popup (bootstrap modal) with the list of friends of the user. I have a test function for obtaining the list of friends in my views.py and it works well. What I need is that after the facbook dialog box login, it goes to this function, gets the friendlist, and return the result in a popup on the original page. I

Adding a FileField to a custom SignupForm with django-allauth

被刻印的时光 ゝ 提交于 2020-01-06 19:55:27
问题 I have the following custom SignupForm (simplified, works perfectly without my_file): class SignupForm(forms.Form): home_phone = forms.CharField(validators=[phone_regex], max_length=15) my_file = forms.FileField() def signup(self, request, user): new_user = ReqInfo( user=user, home_phone=self.cleaned_data['home_phone'], my_file=my_file, ) new_user.save() In models.py: class ReqInfo(models.Model): user = models.OneToOneField(User, on_delete=models.CASCADE, blank=True, null=True) home_phone =

Django rest registration

给你一囗甜甜゛ 提交于 2020-01-01 06:35:36
问题 I am using Django-rest-auth (https://github.com/Tivix/django-rest-auth) in my django project for login and registration. I see a default registration form as follows: Currently I am being able to register a new user with email instead of username. The default auth_user table in my MySql database has following columns: (id, password,last_login, is_superuser, username, first_name, last_name, email, is_staff, is_active, date_joined) My settings.py : INSTALLED_APPS = ( 'django.contrib.admin',

Django AllAuth Installation

≡放荡痞女 提交于 2019-12-31 23:09:13
问题 I'm attempting to install and configure Django AllAuth and I've run into a plethora of obstacles. Im afraid I'm simply missing a few basic concepts which might clear some things up. 1) In order to get basic social authentication working what setup needs to be done inside the social provider (facebook, twitter, etc..) 2) If this is the case then how would one develop locally because at first glance of twitter's API setup it asks for redirect URLs which would get hairy considering everything

How to differentiate the first time registered and regular logged in user in django

◇◆丶佛笑我妖孽 提交于 2019-12-31 03:04:07
问题 I am using django allauth for all my signin, signup and logout functionality and working fine. Now i have a functionality that, 1.when a user is registered and logged in for the first time, i need to redirect him to a success page/verification page( /success/ ) 2.When a user who is already registered is logged in, he should be redirected to /dashboard/ As of now i am redirected the user(first time registered and already registered) to /dashboard/ by a setting called LOGIN_REDIRECT_URL in

How to move singup\signin templates into dropdown menu?

℡╲_俬逩灬. 提交于 2019-12-30 07:54:07
问题 I have a fixed navigation and I want to add dropdown box where users can singup\in (as Twitter uses). I tried: # project/tempates/signup.html {% load i18n %} {% load account socialaccount %} {% block head_title %}{% trans "Signup" %}{% endblock %} {% block content %} <h1>{% trans "Sign Up" %}</h1> <p>{% blocktrans %}Already have an account? Then please <a href="{{ login_url }}">sign in</a>.{% endblocktrans %}</p> <form class="signup" id="signup_form" method="post" action="{% url 'account

How do I resolve Django AllAuth - 'Connection aborted.', error(13, 'Permission denied') Error?

我是研究僧i 提交于 2019-12-30 04:40:29
问题 I'm trying to resolve a connection error thrown by AllAuth/Django 1.7 running on Google App Engine: I believe the error may be in the Sessions configuration but I've not been able to identify the problem. Local signup is functioning correctly, but social logins throw an error. edit: LinkedIn works fine. edit: On the local server; I get "must be _socket.socket, not socket" after entering credentials. edit: There seems to be some ambiguity with what AppEngine serving http or https; although the

django-allauth: how to properly use email_confirmed signal to set user to active

回眸只為那壹抹淺笑 提交于 2019-12-29 04:48:07
问题 In another post, I mentioned that I was trying to use allauth's email_confirmed signal to change the is_active field on the confirmed user to true. However, the following code gave me the exception "User matching query does not exist." from allauth.account.signals import email_confirmed from django.dispatch import receiver from django.contrib.auth.models import User @receiver(email_confirmed) def email_confirmed_(request, email_address, **kwargs): user = User.objects.get(email=email_address)

Allauth login on homepage not working

此生再无相见时 提交于 2019-12-25 08:28:52
问题 To allow Django's allauth to work on my homepage, I copied the allauth HTML for the login and signup forms to my own base.html (The login form can be seen here). So this successfully renders the form and its fields on my homepage. However, when I click submit on the login form, it just redirects me to allauth's /accounts/login URL, which renders the same form. Only after that does submitting the form work. It's the same with the signup form when I submit the signup form on my homepage, it