How th3g3ntl3m3n/jewellerydjango works
Main Components
• Web Client: Represents the browser or user interface that accesses the website.
• Django Application Server: This includes two key areas:
• Project Configuration (the “jewelry” directory): Contains settings.py, urls.py, and wsgi.py, which set up overall system configuration and request routing.
• Application Logic (the “shop” app): Holds the business logic, models, views, templates (HTML), static files (CSS, JavaScript, images found under shop/static/shop), and forms. The “shop” app is responsible for handling user interactions such as registration, login, shopping cart management, and checkout logic.
• Database: Represented by db.sqlite3, which is used by Django to store models data (like jewelry items, users, orders, etc.).
• Supporting Assets:
• The “product_photo” directory which may store product images or supplementary product-related assets.
• Django migrations (in shop/migrations) ensure the database schema is maintained and versioned.
Relationships and Interactions
• The Web Client sends HTTP requests to the Django application.
• The WSGI entry point (jewelry/wsgi.py) and URL routing (jewelry/urls.py) direct these requests to the appropriate view functions within the “shop” app (as defined in shop/views.py).
• The views interact with Django models (shop/models.py) to retrieve or update data in the db.sqlite3 database.
• Business logic may also include form submissions (handled in shop/forms.py) and any validation or processing as needed.
• The rendered HTML templates (located in shop/templates/shop) and static files (in shop/static/shop) are used to generate the response back to the user.
Architectural Patterns and Technologies
• MVT (Django’s variant of MVC) is used; the Model (shop/models.py), the View (shop/views.py), and the Templates (shop/templates/shop) are clearly separated.
• The Django settings (jewelry/settings.py) and URL configuration (jewelry/urls.py) are central to routing HTTP requests and defining middleware, installed apps, and database settings.
• Technologies include Python (as the primary language), Django (as the web framework), SQLite (as the database engine), and Bootstrap (for front-end styling found under shop/static/shop/bootstrap).