Zer0Store is an e-commerce web application built with Django, allowing users to browse products, view product details, and manage their shopping cart efficiently. The project aims to provide a seamless and user-friendly shopping experience.
- Home Page: Displays a list of available products with details like name, image, old price, and new price.
- Product Page: Detailed view of products including descriptions and prices.
- Cart Page: Allows users to manage their cart, view total prices, and proceed to payment.
- Dynamic UI: Responsive design with Bootstrap for a smooth user experience.
- Persistent Cart: Cart items are managed using localStorage for persistence across sessions.
Zer0Store/
├── templates/
│ ├── index.html # Home page template
│ ├── product.html # Product details page template
│ ├── carts.html # Cart page template
│ ├── base.html # Base layout for templates
├── static/
│ ├── css/ # CSS files
│ ├── js/ # JavaScript files
│ ├── img/ # Images for the site
├── models.py # Django models for the database
├── views.py # Views for handling HTTP requests
├── urls.py # URL routing
└── README.md # Documentation
-
Clone the Repository
git clone https://github.com/ben041/Zer0Store.git cd Zer0Store
-
Set Up Virtual Environment
python -m venv env source env/bin/activate # On Windows: env\Scripts\activate
-
Install Dependencies
pip install -r requirements.txt
-
Apply Migrations
python manage.py makemigrations python manage.py migrate
-
Run the Development Server
python manage.py runserver
-
Access the Application
Open your browser and navigate to
http://127.0.0.1:8000
.
from django.db import models
class Products(models.Model):
name = models.CharField(max_length=100)
image = models.ImageField(upload_to='images')
old_price = models.DecimalField(max_digits=10, decimal_places=2, default=0)
new_price = models.DecimalField(max_digits=10, decimal_places=2, default=100)
description = models.TextField(max_length=400)
def __str__(self):
return self.name
from django.shortcuts import render
from .models import Products
def home(request):
product = Products.objects.all()
return render(request, 'index.html', {'product': product})
def cart(request):
return render(request, 'carts.html')
def product(request):
product = Products.objects.all()
return render(request, 'product.html', {'product': product})
from django.urls import path
from django.conf import settings
from django.conf.urls.static import static
from . import views
urlpatterns = [
path("", views.home, name="home-page"),
path("cart", views.cart, name="cart-page"),
path("product", views.product, name="product-page"),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
- Backend: Django
- Frontend: HTML, CSS, Bootstrap, JavaScript
- Database: SQLite (default, can be replaced)
- Deployment: Django development server
Contributions are welcome! Please fork this repository and submit a pull request.
This project is open-source and available under the MIT License.
For inquiries or support, reach out to Ben.
Feel free to adjust the placeholders and add any additional details!