Basically, the goal is to have valid username/password pair for each registered user.
I think the proper way to do that is to create custom form for social signup.The default workflow for social signup is:
User clicks "Sign in with PROVIDER_NAME";
User gives access to my app on provider's site;
Site redirects him to my app where he should fill additional fields like username etc. and complete registration.
And I need to ask user for passwords too at the last step. Form should validate that passwords and save it to user.
Any ideas? Have no idea how can it be implemented with custom form or adapter.
The purpose of allauth, is to avoid the user to create a new username/password for your site.
However, you can configure a form to add that information.
Set up the form you want to show to the user.
ACCOUNT_SIGNUP_FORM_CLASS = 'project.forms.MyUserForm'
Related
I was wonder if it is possible to include a way that when someone fill the user registration form to register, can the details be sent to an admin email for authorization before the user can login in django?
Since you did not provide any code I will guide you the process, you can later come back more specific question if you are stuck :
Use the field is_active provided by Django from the User model to authorised access within your website.
Extends the field is_active to set the default to False or set it to false in the begging of your user view
Create a link with the ID of the user and a path to the Django Admin where you can update the user and active to True
In short yes, possible and pretty easy if you know a bit of Django.
I am trying to register the user by sending an OTP to their mail. Consider the following usual:
the user posts a request for registration with an email, password. (email mapped to the username of Django).
Django creates the user and the user gets the OTP for verification. If the user verifies, an 'is_verified' field will be set to true.
Now, If the user doesn't verify himself with the OTP, I can't get around the following issues. Please suggest a workaround.
---> Any other user can now not use the same email for registration, as email already exists in the database.
I want the user to be updated in the database only after the user has successfully verified the otp.
What is the best way to implement django 2 login and registration like instagram.com. user can register with username and email or phone and password. after register user can login with email address, phone number or username.
Thanks
A great thing about Django is that it comes with a User model already. You just have to apply it to your site.
Check out the user documentation Here
This will give you all the fields you can use, and how to make a member style website
I created three devise models user, admin, trainer. For user and admin i want login with email and password. For trainer I want login with username and password. How we can achieve this ?
Your Users and Admin should already be logging in with email and password by default with Devise.
To set up login with username for your Trainers checkout this link.
https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-sign-in-using-their-username-or-email-address
This will allow your Trainers to login with either username or email. You can display either on the pages because we are adding a username migration to the trainers model.
You will also need to add field to the Trainer signup page.
How to add an extra field to django allauth registration flow.
1. First step- Django allauth registration using email or fblogin (this is working for me, the user is able to register through facebook or email)
2. I want to add the following fields/attributes to the user registration but as a second step.
The new attributes are 1. DOB, Address, Phone no, Linkedin login and a user profile score
Answer to block one can be found here
How to customize user profile when using django-allauth
for Block 2,
Add this to your settings.py
INSTALLED_APPS = ('allauth.socialaccount.providers.linkedin',
)