A Django-based e-commerce application focused on product management, customer accounts, discounts, orders, reviews, and multilingual support.
The project demonstrates how a modern online store can be structured using Django, PostgreSQL, and a modular application architecture.
SmartProducts is a web-based store application built with Django.
The project includes separate applications for user/account management and store functionality.
The current implementation focuses on core e-commerce concepts such as:
- User authentication and accounts
- Product management
- Product categories
- Product images
- Discounts
- Customers
- Customer addresses
- Orders
- Product reviews and ratings
- Persian language support
- Multilingual configuration
The accounts application provides user-related functionality and uses a custom Django user model.
The project also integrates Django Allauth for authentication.
The custom user model includes additional information such as:
- Phone number
- Address
The store application provides product-related models including:
- Products
- Categories
- Product images
- Discounts
Products contain information such as:
- Name
- Category
- Slug
- Description
- Price
- Inventory
- Active status
- Creation and modification dates
- Product images
- Discounts
Products can be organized into categories.
Categories also support hierarchical relationships through parent/child relationships.
The project provides a dedicated discount model that can be associated with products.
Customer information is separated from the authentication model and includes additional information such as:
- Phone number
- Birth date
Customer addresses include:
- Province
- City
- Street
The project includes an order model containing information such as:
- Customer
- Payment status
- Customer information
- Address
- City
- Province
- Postal code
- Order notes
- Creation and modification timestamps
Products support customer comments and star-based rating aggregation.
The project is configured for internationalization and includes:
- Persian (
fa) - English (
en)
The default project language is configured as Persian.
The project also uses Django Rosetta for translation management.
The project follows Django's application-based architecture:
SmartProducts/
β
βββ accounts/
β βββ migrations/
β βββ admin.py
β βββ apps.py
β βββ forms.py
β βββ models.py
β βββ tests.py
β βββ views.py
β
βββ store/
β βββ migrations/
β βββ admin.py
β βββ apps.py
β βββ models.py
β βββ tests.py
β βββ views.py
β
βββ config/
β βββ settings.py
β βββ urls.py
β βββ asgi.py
β βββ wsgi.py
β
βββ manage.py
βββ requirements.txt
βββ .gitignore
| Application | Responsibility |
|---|---|
accounts |
User and account management |
store |
Products, customers, orders and store-related models |
config |
Django project configuration |
- Python
- Django 5.1
- PostgreSQL
- Django Authentication
- Django Allauth
- Django Crispy Forms
- Bootstrap integration
- Django i18n
- Django Rosetta
- Persian / English support
- Jalali date support
- Django Debug Toolbar
- Python Dotenv
- Environs
The project currently uses a pinned dependency list in requirements.txt.
Major dependencies include:
Django 5.1.3
django-allauth
django-crispy-forms
django-debug-toolbar
django-jalali-date
django-rosetta
psycopg2
Pillow
python-dotenv
environs
For the complete dependency list, see:
requirements.txt
git clone https://github.com/AliValizade/SmartProducts.git
cd SmartProductspython -m venv .venvActivate it on Windows:
.venv\Scripts\activateOn Linux/macOS:
source .venv/bin/activatepip install -r requirements.txtThe project reads sensitive configuration values from environment variables.
Create a .env file in the project root.
Example:
DJANGO_SECRET_KEY=your-secret-key
DEBUG=True
DATABASE_NAME=smartproducts
DATABASE_USER=postgres
DATABASE_PASSWORD=your-password
DJANGO_PORT=5432Never commit real credentials, passwords, or secret keys to the repository.
The project is configured to use PostgreSQL.
After configuring the database and environment variables, run:
python manage.py migrateCreate an administrative user:
python manage.py createsuperuserStart the Django development server:
python manage.py runserverThen open:
http://127.0.0.1:8000/
The project contains Django test modules in the applications.
Run the test suite with:
python manage.py testTest coverage and automated CI are planned improvements for the project.
SmartProducts demonstrates several practical Django development concepts:
- Custom user models
- Django application architecture
- Relational data modeling
- Product and inventory management
- Order management
- Authentication
- PostgreSQL integration
- Internationalization
- Persian localization
- Media handling
- Model relationships
- Django administration
Potential improvements for future versions include:
- Shopping cart improvements
- Payment gateway integration
- Order tracking
- Advanced product search
- Product filtering
- REST API
- Automated testing and coverage
- CI/CD with GitHub Actions
- Improved responsive UI
- Containerized deployment with Docker
- Production deployment configuration
- Better documentation and screenshots
This project represents practical work with Django and demonstrates the implementation of an e-commerce application's core domain models and supporting infrastructure.
It is also part of the author's broader experience with Python and Django web application development.
Ali Valizadeh
Python Developer Β· Django Β· AI, NLP & Automation Β· University Instructor
GitHub: