contact@digitalnotebooks.co
Stay Organized, Stay Inspired. Let's Write.

Car Listing: User Registration, Login, Logout, Dynamic Page Title Part 13

Back To All Notes
  • Notebook: Django Project: Car Listing
  • Speaker: Udemy Instructor Rathan Kumar
  • Date Created: July 20, 2024, 9:54 p.m.
  • Owner: Rosilie

This is the continuation of the REGISTER FUNCTIONALITY from Part 12.

1. Go to ACCOUNTS\VIEWS.PY and update

2. Update your REGISTER.HTML

3. You can test it. We updated our ViEWS.PY if we want the user to be logged in automatically or not.

4. Update the LOGIN.HTML as

FROM:

TO:

5. Now, for the LOGIN function, update our VIEWS.PY as

6. Run the server and test the LOGIN. You should be able to see the error message if incorrect credentials were used otherwise, we should be logged in to our DASHBOARD.

7. For LOGOUT, we update our TOPBAR.HTML to show a LOGOUT if the user has logged in.

FROM:

TO:

8. We update our VIEWS.PY to accept the FORM LOGOUT POST METHOD.

9. When you are in the dashboard and need to logout, you should be directed to the homepage.

10. We want to change the web page title dynamically based on what webpage we are in.

We go to our TEMPLATES\BASE.HTML and find the TITLE SECTION.

FROM:

TO:

11. Then in each webpage like PAGES\HOME.HTML, update it as

So when you run your server.  You need to update each of your webpages to write the customized page title.

 

12. To show the CAR TITLE  as part of the PAGE TITLE, we modify CAR_DETAILS.HTML as:

FROM:

TO:

Click on a specific car. The car title should be visible as part of the page title.

 



No PDF file attached.

Notebook
Notebook Details
Title: Django Project: Car Listing
Category: Udemy Django Course