django-allauth

Validation error not showing on form

对着背影说爱祢 提交于 2020-02-07 10:19:45
问题 I'm creating a SignUp form and it displays the validation errors, such as required fields. However, using Django-Crispy-Forms, the validation errors do not appear. I'm customizing the default form from Django-allauth, which raises ValidationError. However, using Django-Crispy forms, no errors get displayed on the form. 1.template {% extends "base.html" %} {% load i18n %} {% load crispy_forms_tags %} {% block content %} <div class="big-box"> <p><h1>{% trans "Sign Up" %}</h1></p> <p>{%

Validation error not showing on form

我是研究僧i 提交于 2020-02-07 10:17:32
问题 I'm creating a SignUp form and it displays the validation errors, such as required fields. However, using Django-Crispy-Forms, the validation errors do not appear. I'm customizing the default form from Django-allauth, which raises ValidationError. However, using Django-Crispy forms, no errors get displayed on the form. 1.template {% extends "base.html" %} {% load i18n %} {% load crispy_forms_tags %} {% block content %} <div class="big-box"> <p><h1>{% trans "Sign Up" %}</h1></p> <p>{%

Redirect to Custom Form page before successful signup

ぃ、小莉子 提交于 2020-02-04 20:41:23
问题 During Facebook Signup, I need to store user mobile number (required field). How can I achieve that? I tried to implement this via signal but I couldn't able to redirect page to required template. Though it isn't recommended. @receiver(user_signed_up) def user_signed_up_(request, user, sociallogin=None, **kwargs): ''' When a social account is created successfully and this signal is received, django-allauth passes in the sociallogin param, giving access to metadata on the remote account, e.g.:

Redirect to Custom Form page before successful signup

耗尽温柔 提交于 2020-02-04 20:40:02
问题 During Facebook Signup, I need to store user mobile number (required field). How can I achieve that? I tried to implement this via signal but I couldn't able to redirect page to required template. Though it isn't recommended. @receiver(user_signed_up) def user_signed_up_(request, user, sociallogin=None, **kwargs): ''' When a social account is created successfully and this signal is received, django-allauth passes in the sociallogin param, giving access to metadata on the remote account, e.g.:

Django Allauth - How to add custom css class to fields?

余生颓废 提交于 2020-02-01 04:30:06
问题 In login.html I have: <form class="login" method="POST" action="{% url 'account_login' %}"> {% csrf_token %} {{form.as_p}} How in the world can I add custom css classes and other atributes to the fields? Nobody on the internet seems to have had this problem before. I just need to add something as simple as a class. Thanks in advance if someone answers this. I really hope this will be helpful for someone else. 回答1: You are using the HTML Django creates for you by calling form.as_p just like

Django Login/Session Not Sticking

大憨熊 提交于 2020-01-25 10:30:09
问题 After my site has been up and running for a while in production, I suddenly have a problem with my users loging into it. I have protected certain views/pages with the login_required decorator and I am also using the django admin. When an anonymous user hits any of these pages, he is redirected to the login page. When this anonymous user adds its credentials, the POST request is successful and he is redirected to the inital page. At the same time, the user gets a new sessionid (as expected)

How could one disable new account creation with django-allauth, but still allow existing users to sign in? [duplicate]

て烟熏妆下的殇ゞ 提交于 2020-01-12 07:08:54
问题 This question already has answers here : Turn off user social registration in django-allauth? (2 answers) Closed 4 years ago . We've been running a site for a while which uses django-allauth for authentication using any of: Traditional email-based sign-up Google login Twitter login Facebook login ... but now we want to stop anyone creating a new account, while still allowing people who've previously created an account using any of those methods to be able to log in. Is there a setting that

How could one disable new account creation with django-allauth, but still allow existing users to sign in? [duplicate]

偶尔善良 提交于 2020-01-12 07:06:25
问题 This question already has answers here : Turn off user social registration in django-allauth? (2 answers) Closed 4 years ago . We've been running a site for a while which uses django-allauth for authentication using any of: Traditional email-based sign-up Google login Twitter login Facebook login ... but now we want to stop anyone creating a new account, while still allowing people who've previously created an account using any of those methods to be able to log in. Is there a setting that

Django allauth example [Errno 61] Connection refused

人盡茶涼 提交于 2020-01-11 18:27:27
问题 I have the following error when I run django allauth example and it tries to send an email: File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 571, in create_connection raise err error: [Errno 61] Connection refused Under OS X 10.9.1 回答1: From allauth documentation: When I sign up I run into connectivity errors (connection refused et al) You probably have not got an e-mail (SMTP) server running on the machine you are developing on. Therefore, allauth

django django-allauth save extra_data from social login in signal

纵饮孤独 提交于 2020-01-11 12:11:44
问题 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.