django-allauth

Django-allauth with multiple profile models

我们两清 提交于 2019-12-01 07:24:54
问题 I have a django project in which there are multiple profile models, each having a foreign key to the User model. It uses django-allauth for registration. Currently, when registering using a social account, the user registers, a User and a socialaccount is created, then the user is redirected to a form to fill out, depending on what profile type s/he chose earlier, and after filling out that form is the correct profile type created. I'd like it if the user, socialaccount and profile type

Custom Form Validation in Django-Allauth

荒凉一梦 提交于 2019-12-01 05:15:14
I want to do some extra validation on fields in django-allauth. For example I want to prevent using free email addresses. So I want to run this method on signup def clean_email(self): email_domain = self.cleaned_data['email'].split('@')[1] if email_domain in self.bad_domains: raise forms.ValidationError(_("Registration using free email addresses is prohibited. Please supply a different email address.")) Similarly I want to run custom validation on different fields other than email address. How can I perform this? There are some adapters on the allauth configuration. For example this one:

How to move singup\\signin templates into dropdown menu?

非 Y 不嫁゛ 提交于 2019-12-01 01:55:04
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_signup' %}"> {% csrf_token %} {{ signupform.as_p }} {% if redirect_field_value %} <input type="hidden" name

Saving custom user model with django-allauth

纵然是瞬间 提交于 2019-11-30 21:27:50
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 Meta: model = MyUser def save(self, user): user.first_name = self.cleaned_data['first_name'] user.last

Turn off user social registration in django-allauth?

半城伤御伤魂 提交于 2019-11-30 21:06:34
I noticed looking through the django-allauth templates there's a signup_closed.html users can be redirected to when user registration is closed or disabled. Does anyone who's familiar with that module know if there's a pre-configured setting that can be set in settings.py to turn off new user registration via existing social apps? Or do I need to configure that myself? I've read the full docs for allauth and I don't see any mention of it. Thanks. Looks like you need to override is_open_for_signup on your adapter. See the code . More information at http://django-allauth.readthedocs.io/en/latest

using django-allauth

╄→гoц情女王★ 提交于 2019-11-30 21:00:53
i am having trouble using django-allauth. I am getting this error. NoReverseMatch at /accounts/login/ Reverse for 'facebook_channel' with arguments '()' and keyword arguments '{}' not found. So far I have followed everything to the letter. here is my settings.py INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', # Uncomment the next line to enable the admin: 'django.contrib.admin', # Uncomment the next line to enable admin documentation: # 'django.contrib.admindocs'

Turn off user social registration in django-allauth?

扶醉桌前 提交于 2019-11-30 17:00:27
问题 I noticed looking through the django-allauth templates there's a signup_closed.html users can be redirected to when user registration is closed or disabled. Does anyone who's familiar with that module know if there's a pre-configured setting that can be set in settings.py to turn off new user registration via existing social apps? Or do I need to configure that myself? I've read the full docs for allauth and I don't see any mention of it. Thanks. 回答1: Looks like you need to override is_open

Django allauth - Multiple social accounts with a custom user

江枫思渺然 提交于 2019-11-30 16:23:40
I've been trying to find how to add a new social account to a user that has already signed up and loged in, using django-allauth . So far, I have found this question , and this other question related to what I need, but what is suggested doesn't work. I'm using a custom User class, which authenticates through email, and once I have the first social account successfully created, it wont let me add another one. I've tried putting the provider_login_url in a page where the user is authenticated, as suggested in one of the mentioned answers, but it seems to do logout and then try to sign up again,

django-allauth: custom user generates IntegrityError at /accounts/signup/ (custom fields are nulled or lost)

て烟熏妆下的殇ゞ 提交于 2019-11-30 15:11:21
I'm trying to integrate django-allauth with a custom user model (subclassed AbstractUser, but when I test the signup form I get an integrity error due to field (date_of_birth) being null, but the value submitted was u'1976-4-6' I'm learning the new custom user stuff, as well as class-based views as I'm learning django-allauth, so I'm confident that I'm doing something wrong, but after a couple days of reading the github issues, the few tutorials, readthedocs, and stackoverflow questions I still have no clear idea of what I'm doing wrong (well I know one thing I'm doing wrong: trying different

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

不羁岁月 提交于 2019-11-30 14:01:12
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 page is https, the URI is being received as http. edit: My packages per pip freeze: AppEngine-Email