Project Challenge: Inserting Users in Sign-Up
In this lesson, we will be modifying the sign-up method to insert users in the database.
We'll cover the following
Problem statement
In this challenge, we will be modifying the signup
view that we made previously. In that function, we were inserting new users into the list. However, now that we have the models created, we should insert the new users into them. Your application should do the following tasks:
-
Modify the
signup
view to insertnew_user
in the database. -
If the
unique
constraint of theemail
column is violated, then a message should be shown on the template saying, “This email already exists in the system! Please log in instead.” -
Handle the above mentioned exception gracefully, i.e. your application should not crash.
Get hands-on with 1400+ tech skills courses.