Assignment 4: Implementing Forms and Authentication Using Django
Platform-Based Programming (CSGE602022) - Organized by Faculty of Computer Science, University of Indonesia, Odd Term 2022/2023
Description
In this assignment, you will implement the <form> element, authentication concepts, and some of the things you learned during the lab tutorial.
The checklist for this assignment is as follows:
- Create a new application called - todolistin the previously deployed Django task project.
- Add the path - todolistso that users can access http://localhost:8000/todolist.
- Create a - Taskmodel that has the following attributes:- userto associate the task with the user who created the task.- You can use the model type - models.ForeignKeywith the parameter- User.- To learn more about - ForeignKeyin Django, you can read the Django documentation (or click here).- To learn more about - Usermodel in Django, click here.
- dateto describe the date the task was created.
- titleto describe the title of the task.
- descriptionto describe the description of the task.
 
- Implement the registration, login, and logout forms so that users can use - todolistproperly.
- Create a - todolistmain page that contains the user's username, the- Add New Taskbutton, the logout button, and a table containing the task creation date, task title, and task description.
- Create a form page for task creation. The only data the user needs to enter is the task title and task description. - You can read Django's documentation on - Forms[here] (https://docs.djangoproject.com/en/4.1/topics/forms/).
- Create a - routingso that some functions can be accessed via the following URL:- http://localhost:8000/todolist contains the main page containing the task table.
- http://localhost:8000/todolist/login contains the login form.
- http://localhost:8000/todolist/register contains the account registration form.
- http://localhost:8000/todolist/create-task contains the task creation form.
- http://localhost:8000/todolist/logout contains the logout mechanism.
 
- Deploy your project to the Heroku that you have created so that it can later be accessed by your friends via the Internet. 
- Create two user accounts and three dummy data using the - Taskmodel on each account at Heroku application website.
- Create a - README.mdin the- todolistfolder that contains the link to your deployed Heroku application and the answers to the following questions:-  What does {% csrf_token %}do in the<form>element? What happens if there is no such "code snippet" in the<form>element?
-  Can we create the <form>element manually (without using a generator like{{ form.as_table }})? Explain generally how to create<form>manually.
- Describe the data flow process from the submission made by the user through the HTML form, data storage in the database, until the appearance of the data that has been stored in the HTML template.
- Explain how you implement the checklist above.
 
-  What does 
Deadline
Deadline for Assignment 4:
Invalid Date (0 days 0 hours 0 minutes 0 seconds left)
The teaching assistant will check the last commit of the assignment repository, so you do not need to submit the repository link into the submission slot.
Bonus
You will get bonus marks on this assignment if you create the following features.
-  Add an is_finishedattribute to theTaskmodel (with the default value ofFalse) and create two new columns in the task table containing the completion status of the task and a button to change the completion status of a task toFinishedorUnfinished.
- Add a new column to the task table containing a button to delete a task.
Both features above must be implemented (not just a button, but these features must be able to perform the desired behavior) if you want to get bonus points.
Motivation: By completing the bonus features, you have learned the basics of CRUD in Django. 😉