---
# System prepended metadata

title: 'Assignment 2: Model-View-Template (MVT) Implementation in Django'

---

---
sidebar_label: Assignment 2
sidebar_position: 2
Path: assignments/individual/assignment-2
---

# Assignment 2: *Model-View-Template (MVT)* Implementation in Django

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

---

## Assignment Description

In this assignment, you will implement the *Model-View-Template* concept along with several concepts you have learned in class and tutorials. Please note that the project you create for this assignment is **different** from the one used in the tutorial.

## Application Theme

The main theme of the PBP assignment is a *Football Shop* application. You are free to choose the name and sub-theme of the application. Make your project as creative as possible and make sure it follows the specified theme.

:::danger
Make sure the name and content of your assignment **DO NOT** contain any **NSFW/18+** and violate SARA (Ethnicity, Religion, Race, and Inter-group Relations). Violating this rule may result in consequences that could potentially affect other courses, such as having your GitHub account suspended
:::

Your application must have the following attributes in its model:

- `name` as the name of the *item* with type `CharField`.
- `price` as the price of the *item* with type `IntegerField`.
- `description` as the description of the *item* with type `TextField`.
- `thumbnail` as the item image with type `URLField`.
- `category` as the item category with type `CharField`.
- `is_featured` as the featured status of the item with type `BooleanField`.


You are allowed to add other attributes if you wish, such as `stock`, `rating`, `brand` and so on. However, your application’s model must include the six required attributes above (`name`, `price`, `description`, `thumbnail`, `category`, `is_featured`). The names of these attributes can be adjusted to fit the needs of your application.

Some ideas for application management that you can make are as follows:

- *Sigma Sportswear*: `name`, `price`, `description`, `thumbnail`, `rating`, `size`.
- *Garuda Shop*: `name`, `price`, `description`, `thumbnail`, `category`,`stock`.
- Football Shop: `name`, `price`, `description`, `thumbnail`, `quantity`, `brand`.

## Assignment Checklist

*Checklist* for this assignment is as follows:

- [ ] Create a new Django project
- [ ] Create an application named `main` within that project.
- [ ] Configure *routing* in the project so that the `main` application can run.
- [ ] Create a model in the `main` application named `Product` with the following required attributes:
    - `name` as the name of the *item* with type `CharField`.
    - `price` as the price of the *item* with type `IntegerField`.
    - `description` as the description of the *item* with type `TextField`.
    - `thumbnail` as the item image with type `URLField`.
    - `category` as the item category with type `CharField`.
    - `is_featured` as the featured status of the item with type `BooleanField`.
- [ ] Create a function in `views.py` that returns data to an HTML *template* displaying the application name along with your name and class.
- [ ] Create *routing* in the `urls.py` file of the `main` application to map the function you created in `views.py`.
- [ ]  Deploy the application to PWS so that your peers can access it via the Internet.
- [ ]  Create a `README.md` file containing a link to the deployed PWS application, as well as answers to the following questions:
    - Explain how you implemented the checklist above step by step (**not just by following a tutorial**).
    - Create a diagram showing the client request to the Django-based web application along with its response, and explain in the diagram the relationship between `urls.py`, `views.py`, `models.py`, and the `html` file.
    - Explain the role of `settings.py` in a Django project!
    - How does database migration work in Django?
    - In your opinion, among all the available frameworks, why is Django chosen as the starting point for learning software development?
    - Do you have any feedback for the teaching assistant regarding Tutorial 1 that you have previously completed?

:::info
**Tips** : You can attach either a link or upload an image to your `README.md` file for questions involving diagrams or images. 
:::
::: danger
Please note that you must complete this assignment using a **different** repository from the tutorial. Repositories that do not comply with this requirement will not be graded. 
:::

## Deadline

The deadline for Assignment 2 is **Wednesday, September 10, at 12:00 PM.**

Please submit the link to the repository you used in the submission slot provided on SCELE.

:::warning
If a student submits late, 10 points will be deducted. Plagiarism in any form will not be tolerated.
:::