A Django-based marketplace template for a cosmetics shop.
📋 See REPORT.md for detailed setup audit, branch analysis, and verification results.
This repo is organized as a multi-app Django project (products, users, shops, etc.) with a small “Core” framework that provides:
- Reusable model fields (
Core/fields/*) viaCore.fields.ProjectFields - Shared base models + soft-delete (
Core.models.CoreModelUniversal+Core.managers.BaseManager) - Model mixins for common behavior (slug generation,
__str__, save rules) underCore/ProjectMixins/ - A custom management command to scaffold apps and boilerplate mixins (
customstartapp)
Current UI entry point:
/renderstemplates/Shops/home.htmlviaShops.views.Home.
- Python (3.10+ recommended)
- Django 4.1.4
- Default database: SQLite (
db.sqlite3)
Cosmetic_Shop/— Django project (settings/urls/asgi/wsgi)Core/— shared framework utilities (fields, base models, mixins, generators)Users/— custom user model (AUTH_USER_MODEL = 'Users.User')Products/— product catalog models (Product/Category/Brand/Tag/Comment + through models)Shops/— template-based pages (currently home)Markets/,Costumers/,APIs/— placeholder apps (present inINSTALLED_APPS, currently minimal models)templates/— global templatesstatics/— static assets (CSS/JS/Bootstrap)
This repository has been consolidated from multiple branches to provide a complete e-commerce experience:
- Product Listing (
/products/) - Browse all available products - Product Details - View detailed product information
- Search & Filters - Find products by category, brand, or search term
- Pagination - Easy navigation through large catalogs
- Add to Cart - Add products from detail pages
- Manage Cart (
/cart/) - View, update quantities, or remove items - Cart Summary - Real-time total calculation
- Persistent Cart - Cart saved per user account
- Checkout Process (
/cart/checkout/) - Complete order placement - Order Confirmation - Success page after checkout
- Order Models - OrderItem, Payment, Shipment tracking
- Admin Management - Full order management in Django admin
- Authentication - Login required for cart/checkout
- Custom User Model - Extended with phone, role flags
- Admin Access - Full Django admin panel
- Responsive Design - Bootstrap 5 templates
- Navigation - Consistent navbar across all pages
- Messages - User feedback for cart actions
- Clean Layout - Professional cosmetics shop appearance
| App | What it’s for | Notes |
|---|---|---|
Core |
Base models, managers, reusable field definitions, mixins, code generators | CoreModelUniversal provides id, timestamps, and soft-delete fields. |
Users |
Custom user model | Extends AbstractUser and adds phone_number, flags like is_costumer / is_market, and a slug. |
Products |
Product catalog with views | Product/Category/Brand/Tag models + list/detail views with filtering/search |
Shops |
Shop models & pages | Order, OrderItem, Payment, Shipment, Address, Coupon, Discount models + home page |
Costumers |
Shopping cart & checkout | Cart, CartItem models + cart views + checkout flow |
Markets |
Marketplace seller-side (placeholder) | Reserved for future marketplace features |
APIs |
Future API endpoints (placeholder) | Not currently wired into root urls.py. |
This project sets:
AUTH_USER_MODEL = 'Users.User'
The user model is defined in Users/models.py and adds a phone_number field plus role flags.
You’ll see patterns like:
ProjectFields.CustomNameField(class_name="Product")
Those field factories are aggregated in Core/fields/ProjectFields.py and implemented in the various modules inside Core/fields/.
This design keeps field options (verbose names, validators, indexes, defaults) centralized.
Most domain models inherit from Core.models.CoreModelUniversal, which provides:
idcreated_at,modified_atis_delete(soft-delete flag)objects/subsetmanagers (Core.managers.BaseManager)
BaseManager includes helpers like:
get_deleted()restore()hard_delete()
Common behavior is implemented as mixins under Core/ProjectMixins/.
For example:
Core/ProjectMixins/Base/Save.pycontains save mixins likeSaveNameandSaveId(for slug generation)Core/ProjectMixins/Base/Str.pycontains__str__mixins likeName,ID, etc.
-
Root URLConf:
Cosmetic_Shop/urls.py/admin/→ Django Admin/→include('Shops.urls')
-
Shops/urls.py/→Shops.views.Home(class-based view)
-
Shops/views.py- Renders
templates/Shops/home.html
- Renders
- Python installed and on PATH
- Recommended: create a virtual environment
This repo ships with a minimal requirements.txt (Django only). If you add packages later, pin them there.
python -m venv .venv
.\.venv\Scripts\activate
pip install -r requirements.txtpython manage.py migrate
python manage.py createsuperuser
# Note: Custom user model requires phone_number field (e.g., 1234567890)python manage.py runserverOpen:
- Home: http://127.0.0.1:8000/
- Admin: http://127.0.0.1:8000/admin/
-
Templates live in:
templates/(project-level)*/templates/(app-level, if present)
-
Static assets live in
statics/and are configured inCosmetic_Shop/settings.py:STATICFILES_DIRS = [BASE_DIR / 'statics/']STATIC_URL = 'statics/'
Note: Django convention is usually
STATIC_URL = '/static/'. This project currently usesstatics/.
There’s a custom management command at:
Core/management/commands/customstartapp.py
It wraps startapp and can also generate boilerplate for mixins and model scaffolding.
Examples:
# Create an app and generate scaffolding
python manage.py customstartapp --a MyApp --p Cosmetic_Shop --m ModelA ModelB --s SomeScopeParent --o soft
# Batch mode: read definitions from Core/management/AppMaker/making.txt
python manage.py customstartapp --o from --f making.txtOptions:
--o soft(default): only add missing files/classes--o hard: overwrite--o delete: remove generated files--o from: batch create from a text file
Default database is SQLite:
db.sqlite3in project root
To switch to Postgres/MySQL later, update the DATABASES setting.
Django admin is enabled at /admin/.
If you customize admin registrations, you’ll do it in each app’s admin.py.
These are worth reviewing before deploying:
SECRET_KEYis hard-coded inCosmetic_Shop/settings.py(move to environment variable for production)DEBUG = True(must beFalsein production)ALLOWED_HOSTScontains a likely typo:"192,168.8.120"(comma vs dot)- No
MEDIA_ROOT/MEDIA_URLconfigured yet (needed for user uploads)
Automated tests aren’t implemented yet (each app has a tests.py placeholder).
To run Django tests:
python manage.py testSee LICENSE.