ShopEase Project - Day 1 Progress
Day 1 of the ShopEase project focused on setting up the foundational elements of the Django
e-commerce platform. The tasks included setting up the Django environment, creating a product
model, and displaying products on the homepage. Below is a detailed breakdown of the steps
accomplished.
1. Setting Up the Django Project
We began by creating a virtual environment to isolate dependencies and installing Django using pip.
Then, we created the Django project named 'shopease' and the app 'store'. This setup organized the
project into manageable components.
2. Creating the Product Model
In 'store/[Link]', we defined the Product model with fields for name, description, price, and
image. The model was then registered in the admin panel, allowing us to manage products via the
Django admin interface. We ensured migrations were made and applied successfully.
3. Setting Up the Product List View
In 'store/[Link]', we created a view function named 'product_list' to fetch all products from the
database. This function renders a template to display the list of products.
4. Configuring URLs
We configured URLs to connect the product list view with a specific route. This involved adding
'path('', product_list, name='product_list')' to 'store/[Link]' and including '[Link]' in
'shopease/[Link]'.
5. Setting Up Templates
We created the 'templates/store/product_list.html' file to structure the product display. This template
uses Django's template language to dynamically display product information.
6. Configuring Static and Media Files
To enable the display of product images, we configured Django to serve static and media files. This
included adding settings in '[Link]' and mapping URLs in '[Link]'. Images are stored in the
'products/' directory.
7. Testing the Application
After running the development server, we verified the homepage displayed the product list correctly.
We resolved several issues, including URL configuration and missing images, ensuring the page
works as intended.
Conclusion
By the end of Day 1, we successfully set up the core structure of ShopEase, including models,
views, templates, and configurations for media files. This foundation will allow us to expand the
e-commerce functionality in the coming days.