Skip to main content

Assignment 4: Implementing Authentication, Sessions, and Cookies in Django

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


Assignment Description

In this assignment, you have to implement the concepts of authentication, session, cookies, and apply several concepts learned in the tutorial.

Checklist for this assignment is as follows:

  • Implement registration, login, and logout functions to allow users to access the previous application.

  • Create two user accounts with three dummy data entries for each account using the model previously created in the application.

  • Connect Item model with User.

  • Display the information of the logged-in user, such as their username, and applying cookies, such as last login, on the main application page.

  • Answer the following questions in the README.md in the root folder (add new subheadings for each assignment).

    • What is UserCreationForm in Django? Explain its advantages and disadvantages.
    • What is the difference between authentication and authorization in Django application? Why are both important?
    • What are cookies in website? How does Django use cookies to manage user session data?
    • Are cookies secure to use? Is there potential risk to be aware of?
    • Explain how you implemented the checklist above step-by-step (not just following the tutorial).
  • Perform add-commit-push to GitHub.

Deadline

The deadline for Assignment 4 is Wednesday, 27th September 2023, 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.

Bonus

You will gain bonus points for this assignment if you implement the following features.

  • Add a button to increment the amount of an item and a button to decrement the amount of an item.
  • Add a button to delete an item from the inventory.

Both of the features must be implemented (not just by adding the buttons, but they should able to perform the desired functions) if you want to receive a bonus score.