django-allauth

django-allauth set username the same as email

时光毁灭记忆、已成空白 提交于 2019-12-05 03:43:40
I have a sign up form which asks only for email and password. When a user signs up, django-allauth creates a username for that user by striping the "@email" suffix form the user's email address. So for example, if a user signs up with " some-user@example.com " his username will be " some-user " and if another user signs up with " some-user@gmail.com " then his username will be " some-userr " But what I want is the username and email of the users to have the same value. So how can I configure django-allauth to set the usernames as the users emails without striping their suffixes? And if

Django allauth not sending links with https

半腔热情 提交于 2019-12-05 01:51:05
问题 I want Django Allauth to send links like the confirm e-mail or reset password with https : Something like this: https://example.com/ca/accounts/confirm-email/picuwfpjpptjswi50x5zb4gtsqptmwkscea445kadnbsfwcyij3fdnblery4onuq/ According to the official documentation only changing the following setting in settings.py it should work: ACCOUNT_DEFAULT_HTTP_PROTOCOL = "https" But I keep getting the links with http instead of https like this: http://example.com/ca/accounts/confirm-email

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

北慕城南 提交于 2019-12-04 19:32:41
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_kwargs() kwargs.update({ 'instance': self.request.user }) return kwargs We are using basic default setup of

django 1.9: ProgrammingError: relation “users_user” does not exist

只谈情不闲聊 提交于 2019-12-04 18:41:53
问题 I am running into a ProgrammingError when doing migrate, I think it may be related to the use of django-allauth with a custom user. Here is what I do 1/ Create a fresh database with psql: create database dj_example; 2/ Installed_apps contain django.contrib.sites: DJANGO_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', ) THIRD_PARTY_APPS = ( 'crispy

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

◇◆丶佛笑我妖孽 提交于 2019-12-04 14:04:16
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" href="{% url 'account_reset_password' %}">{% trans "Forgot Password?" %}</a> <button class="primaryAction

django-allauth: How to set user to active only after e-mail verification

馋奶兔 提交于 2019-12-04 13:43:02
问题 I'm using django-allauth primarily as a way to create user accounts for the admin backend. What I would like to have happen is: 1) When a user goes through the sign up procedure, send out the verification e-mail (I have this working so far) and set the user as inactive, staff, and with the "SurveyManager" group assigned to them by defult. Currently, the user is created with active set to true, staff set to false, and no groups assigned. 2) After clicking the link in their e-mail to verify

Overriding Django allauth login form with ACCOUNT_FORMS

℡╲_俬逩灬. 提交于 2019-12-04 12:26:33
问题 I already overrode the signup form with the simple settings variable ACCOUNT_SIGNUP_FORM_CLASS but to override the login form you need to use ACCOUNT_FORMS = {'login': 'yourapp.forms.LoginForm'} . I have the form I want and it displays perfectly with crispy-forms and Bootstrap3: class LoginForm(forms.Form): login = forms.EmailField(required = True) password = forms.CharField(widget = forms.PasswordInput, required = True) helper = FormHelper() helper.form_show_labels = False helper.layout =

django allauth facebook local development

亡梦爱人 提交于 2019-12-04 11:36:09
I'm using django-allauth for Facebook authentication in developement for a site and have set up accordingly: within the facebook app settings on facebok: Namespace: test_login App Domains: blank Site URL: http://127.0.0.1:8000/ Canvas URL: http://127.0.0.1:8000/ Secure Canvas URL: https://127.0.0.1:8000/ in Django admin I created new Social app: Provider: Facebook name: test_login client_id: xxx Secret: xxx Sites: http://127.0.0.1:8000/ as you can see I added a new site http://127.0.0.1:8000/ instead of example.com . The SITE_ID in the settings.py is the correct one. So everything should be

Django-allauth: custom signup form for socialaccount

送分小仙女□ 提交于 2019-12-04 10:48:40
I have found in this question (and the doc) that one can use ACCOUNT_SIGNUP_FORM_CLASS to define some custom form field presented during account registration. However, this form does not seem to appear in the flow of using a social account (at least not by default). Is there a way to have it, or to easily customize some handlers so that I could introduce such step ? Otherwise, this would give a quite non-unified signup process (people using social accounts would have to go and fill the information afterwards in some settings screen, rather than just being asked it once). As of now you can

django-allauth - Overriding default signup form

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 09:35:06
问题 I'm using this code (in forms.py) for my custom signup form for allauth: class RegistrationForm(UserCreationForm): birth_date = forms.DateField(widget=extras.SelectDateWidget(years=BIRTH_DATE_YEARS)) class Meta: model = get_user_model() fields = ('username', 'email', 'password1', 'password2', 'first_name', 'last_name', 'gender', 'birth_date', 'city', 'country') I have of course specified ACCOUNT_SIGNUP_FORM_CLASS in settings.py to point to this form and it displays the fields which I've put