How sedowo/ecommers_django_project works
Main Components
• Project Core: The Django project setup within the “ecommerce” directory. This includes key files like settings.py, urls.py, wsgi.py, and asgi.py that configure the application.
• Application Layer (“shop”): This directory contains the core e-commerce business logic including models (database schema for items and categories), views, admin configurations, and specific URL routes.
• Templates: HTML interface templates (e.g., item_list, item_detail, cart_detail, checkout) that render the frontend for users.
• Database: A SQLite database (db.sqlite3) that stores data such as items, categories, and user cart details.
• Media Files: The “media” directory that stores uploaded images for items.
• Virtual Environment & Dependencies: Though not explicitly diagrammed, note that the application relies on packages installed via pip into the virtual environment (as indicated by pyvenv.cfg and requirements.txt).
a. “Project Settings & Configuration” (settings.py, urls.py, WSGI/ASGI interfaces).
b. “Shop Application” which is a child component dealing with models, views, URLs, and admin interface.
• “Database” component linked to the “Shop Application” since the models (e.g., Item, Category) interact directly with the SQLite database.
• “Templates” as a front-end presentation layer that connects to the “Shop Application” views for rendering HTML.
• Optionally, include a “Web Server” layer indicating that the development server (or future production server) serves the application.
Architectural Patterns and Data Flow
• Model-View-Template (MVT) pattern:
• Models: Located in shop/models.py (defining Items and Categories)
• Views: In shop/views.py handling business logic for listing items, cart management, checkout
• Templates: In the templates folder used to render HTML pages.
Technology Stack Elements
• Framework: Django as the principal back-end framework.
• Database: SQLite included for data persistence.
• Frontend: HTML templates for the user interface.
• Static & Media Files: Managed via Django’s STATIC_URL, MEDIA_URL, and MEDIA_ROOT configurations.