Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Environmental Variables
.env
spaza-env

#Python
*.pyc

#Database
db.sqlite3

#IDE
.vs

#backupdata
data.json
db.sqlite3.backup
Binary file modified spaza_online/db.sqlite3
Binary file not shown.
Binary file added spaza_online/media/product/BannerImage.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 5 additions & 2 deletions spaza_online/spaza_app/admin.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from django.contrib import admin
from . models import Cart, Customer, OrderPlaced, Payment, Product, Wishlist
from . models import Cart, Customer, OrderPlaced, Payment, Product, Wishlist, ContactMessage
from django.utils.html import format_html
from django.urls import reverse
from django.contrib.auth.models import Group
Expand Down Expand Up @@ -47,7 +47,10 @@ class WishlistModelAdmin(admin.ModelAdmin):
def products(self, obj):
link = reverse("admin:spaza_app_product_change", args=[obj.product.pk])
return format_html('<a href="{}">{}</a>', link, obj.product.title)


@admin.register(ContactMessage)
class ContactMessageAdmin(admin.ModelAdmin):
list_display = ['created_at','name', 'email', 'message']


admin.site.unregister(Group)
Expand Down
3 changes: 1 addition & 2 deletions spaza_online/spaza_app/templates/spaza_app/category.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
<div class="fw-bold">{{prod.title}}</div>
<div class="fw-bold text-danger">
R{{prod.discounted_price}}/-
<small class="fw-light text-decoration-line-through">{{prod.selling_price
}}</small>
<small class="fw-light text-decoration-line-through">{{prod.selling_price}}</small>

</div>

Expand Down
11 changes: 9 additions & 2 deletions spaza_online/spaza_online/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"""

from pathlib import Path
from decouple import config

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
Expand Down Expand Up @@ -76,8 +77,14 @@

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': BASE_DIR/ 'db.sqlite3',
'ENGINE': 'django.db.backends.mysql',
'NAME': config('DB_NAME'),
'USER': config('DB_USER'),
'PASSWORD': config('DB_PASSWORD'),
'HOST': config('DB_HOST'),
'PORT': config('DB_PORT'),
}
}

Expand Down