Python Forum
Registration Form Fields - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Web Scraping & Web Development (https://python-forum.io/forum-13.html)
+--- Thread: Registration Form Fields (/thread-35856.html)



Registration Form Fields - rwahdan - Dec-23-2021

Hi

In django there are 3 fields for registration form which are username, password1 and password2.

Here is what I need:

1. After registration I need the user to br assigned as a staff member.
2. Is there a way to add name and email to the registration form?
3. If answer is yes to question 2, how to use them to be filled in other table called customers?

Thanks.


RE: Registration Form Fields - Jeff900 - Dec-26-2021

I think Corey Schafer already has a good tutorial for user profiles in Django: https://www.youtube.com/watch?v=FdVuKt_iuSI&list=PL-osiE80TeTtoQCKZ03TU5fNfx2UY6U4p&index=8. If I remember correctly, he added data to the standard available database table, or created a new table for it. Not sure how in detail, but one way other other you can create your own data, which you can use your own way. There will probably also a way to edit the standard login form. But I have no experience with it. Perhaps he will also go over that topic.


RE: Registration Form Fields - Addweb - Aug-09-2022

user = User.objects.create_user(user=request.POST['user'], password=request.POST['password1'])
user.first_name = request.POST['first_name']
user.last_name = request.POST['last_name']
user.save()