django-allauth

django allauth custom signup form to assign different groups

拜拜、爱过 提交于 2019-12-07 09:54:56
问题 I have two types of users in the system, I want to assign the appropriate group at the time of signing up. Referring to How to customize user profile when using django-allauth, I thought I can override the Signup form and do something like: class CustomSignupForm(forms.Form): login_widget = forms.TextInput(attrs={'type': 'email', 'placeholder': _('email'), 'autofocus': 'autofocus', 'class': 'form-control' }) email = forms.EmailField(label='Email', widget=login_widget) password = PasswordField

Allauth verified user

五迷三道 提交于 2019-12-07 06:13:50
问题 I'm using django 1.6 with allauth. I've just enabled the email verification stuff and am looking for the best way to identify if a user has a verified email or not . One interesting thing I encountered and wanted to ask about: I noticed that a user can have several email addresses. Why is it so? this makes the above test a bit more complicated since you have to ask "does the user have at least one verified email address?" 回答1: allauth offers a decorator for this: from allauth.account

Django custom 500 error template not displaying request.user

流过昼夜 提交于 2019-12-07 06:07:17
问题 I'm implementing custom 404 and 500 templates, but while the 404.html template seems to return request.user.is_authenticated fine, the 500.html template fails to return anything. I also checked for request.user and it's just blank on the 500 page. This is very strange, because when I trigger the 500 error, I receive the expected error report e-mail, and it clearly has USER properly defined in the request breakdown. Here's the code I'm using in views.py: def handler404(request): response =

Django rest auth with Allauth

て烟熏妆下的殇ゞ 提交于 2019-12-07 04:58:57
问题 I have implemented django rest auth with Allauth and its working fine if I login through google access_token but there is a case when some client device need to login by google id_token . I am getting error if I use id_token instead of access_token { "non_field_errors": [ "Incorrect value" ] } please help me out 回答1: Update your files like ../allauth/socialaccount/providers/google/provider.py : class GoogleProvider(OAuth2Provider): .... def extract_uid(self, data): try: return str(data['id'])

django-allauth: Module “accounts.forms” does not define a “SignupForm” class

女生的网名这么多〃 提交于 2019-12-07 03:52:28
问题 I am getting the following error: django.core.exceptions.ImproperlyConfigured: Module "accounts.forms" does not define a "SignupForm" class settings.py (...) ACCOUNT_SIGNUP_FORM_CLASS = 'accounts.forms.SignupForm' (...) accounts/forms.py from allauth.account.forms import BaseSignupForm class SignupForm(BaseSignupForm): def __init__(self, *args, **kwargs): self.sociallogin = kwargs.pop('sociallogin') user = self.sociallogin.account.user first_name = forms.CharField(label=_('First name'), max

django-allauth returns error “Reverse … with arguments '()' and keyword arguments '{}' not found”

佐手、 提交于 2019-12-06 14:51:55
EDIT: Kevin's answer below solved my issue. Turns out "allauth does not support namespaces" so I shouldn't have introduced this into my urls.py ORIGINAL POST: I have installed django-allauth exactly as per tutorials https://github.com/pennersr/django-allauth I have a very basic problem here; can't get basic user login/out pages working even before I add in social integration. By navigating to /admin, I clicked "log out", so I am not a logged in user. Now when I visit /accounts/login I am met with this error NoReverseMatch at /accounts/login/ Reverse for 'account_signup' with arguments '()' and

A simple and up-to-date way to implement Facebook login in a Django app

Deadly 提交于 2019-12-06 13:53:36
This issue is very common in stackoverflow, and there's a lot of different questions and answers about it, yet I couldn't find exactly what I need. First, I'd like to define exactly what I need: the option to let users log in to my app using their Facebook credentials. The app will save a matching classic Django user. I will only need to use the user's profile picture and to make sure that each time the same Facebook user will be related to the matching Django user. Unfortunately, I find it really frustrating to implement for the following reasons: By now, after reading a lot, I couldn't find

First name, last name and email address leak in forms randomly

余生颓废 提交于 2019-12-06 12:31:26
问题 we have implemented django-allauth into our web app and we are facing random leaks. When a new user enters signup page, sometimes user sees first name, last name and email address of lastly logged user prefilled in signup form . This occurs really randomly, just sometimes. This also happens in profile edit form, which is just simple django form taking instance of user from self.request.user in CBV (FormView) like this: def get_form_kwargs(self): kwargs = super(ProfileView, self).get_form

Django allauth get credentials to make further requests on behalf of the user

天涯浪子 提交于 2019-12-06 12:31:22
I'm working on a Django project that requires user authentication for BitBucket, I have setup allauth such that users can authenticate with Bitbucket, I just don't understand how to make further requests to the Bitbucket API now that the user is authenticated. I understand that allauth is purely for authentication purposes, there is just no documentation on how to access and make further use of the authentication, in this case accessing the credentials (oauth_token) such that I can make further requests on behalf of the resource-owner. I found the authentication details to make a further

Django-allauth Sign Up, Login, and Social Connect into one page

杀马特。学长 韩版系。学妹 提交于 2019-12-06 08:11:21
问题 How do you load both the Social Login, the Login form and Sign Up form to your Index page using django-allauth? Something similar like when you go to facebook.com. accounts/url are already working and I've tried copying the <form class="login" method="POST" action="{% url 'account_login' %}"> {% csrf_token %} {{ form.as_p }} {% if redirect_field_value %} <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" /> {% endif %} <a class="button secondaryAction"