Skip to main content

Assignment 4: The Implementation of Authentication, Session, and Cookies in Django

Platform-Based Programming (CSGE602022) — Organized by the Faculty of Computer Science Universitas Indonesia, Odd Semester 2024/2025


Assignment Description

In this assignment you are going to implement authentication, session, and cookies, as well as several concepts learned in the tutorial.

Checklists for this assignment are:

  • Implement the register, login, and logout functions so that the user can access the application freely.

  • make two user accounts with three dummy data each, using the model made in the application beforehand so that each data can be accessed by each account locally.

  • Connect the models Product and User.

  • Display logged in user details such as username and apply cookies like last login to the application's main page.

  • Answer the following questions in README.md in the root folder. (Modify your README.md that you have already created; add a subtitle for each assignment).

    • What is the difference between HttpResponseRedirect() and redirect()?
    • Explain how the MoodEntry model is linked with User!
    • What is the difference between authentication and authorization, and what happens when a user logs in? Explain how Django implements these two concepts.
    • How does Django remember logged-in users? Explain other uses of cookies and whether all cookies are safe to use.
    • Explain how did you implement the checklist step-by-step (apart from following the tutorial).
  • Perform add-commit-push to GitHub.

Deadline

The deadline for Assignment 4 is Wednesday, 25th September, 2024, at 12:00 p.m.

We will check the last commit of the lab assignment repository, so you do not need to submit the repository link separately.