├── backend ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-38.pyc │ ├── __init__.cpython-39.pyc │ ├── settings.cpython-38.pyc │ ├── settings.cpython-39.pyc │ ├── urls.cpython-38.pyc │ ├── urls.cpython-39.pyc │ ├── wsgi.cpython-38.pyc │ └── wsgi.cpython-39.pyc ├── asgi.py ├── settings.py ├── urls.py └── wsgi.py ├── base ├── __init__.py ├── __pycache__ │ ├── __init__.cpython-38.pyc │ ├── __init__.cpython-39.pyc │ ├── admin.cpython-38.pyc │ ├── admin.cpython-39.pyc │ ├── apps.cpython-38.pyc │ ├── apps.cpython-39.pyc │ ├── models.cpython-38.pyc │ ├── models.cpython-39.pyc │ ├── products.cpython-39.pyc │ ├── serializers.cpython-38.pyc │ ├── serializers.cpython-39.pyc │ ├── shops.cpython-39.pyc │ ├── signals.cpython-38.pyc │ ├── signals.cpython-39.pyc │ ├── urls.cpython-39.pyc │ └── views.cpython-39.pyc ├── admin.py ├── apps.py ├── migrations │ ├── 0001_initial.py │ ├── 0002_order_orderitem_review_review_shop_shippingaddress.py │ ├── 0003_shop_image.py │ ├── 0004_product_image.py │ ├── 0005_auto_20210405_1103.py │ ├── 0006_auto_20210411_1003.py │ ├── 0007_auto_20210411_1038.py │ ├── 0008_auto_20210411_1110.py │ ├── 0009_shop_url.py │ ├── __init__.py │ └── __pycache__ │ │ ├── 0001_initial.cpython-38.pyc │ │ ├── 0001_initial.cpython-39.pyc │ │ ├── 0002_order_orderitem_review_review_shop_shippingaddress.cpython-38.pyc │ │ ├── 0002_order_orderitem_review_review_shop_shippingaddress.cpython-39.pyc │ │ ├── 0003_shop_image.cpython-38.pyc │ │ ├── 0003_shop_image.cpython-39.pyc │ │ ├── 0004_product_image.cpython-38.pyc │ │ ├── 0004_product_image.cpython-39.pyc │ │ ├── 0005_auto_20210405_1103.cpython-38.pyc │ │ ├── 0005_auto_20210405_1103.cpython-39.pyc │ │ ├── 0006_auto_20210411_1003.cpython-38.pyc │ │ ├── 0006_auto_20210411_1003.cpython-39.pyc │ │ ├── 0007_auto_20210411_1038.cpython-38.pyc │ │ ├── 0007_auto_20210411_1038.cpython-39.pyc │ │ ├── 0008_auto_20210411_1110.cpython-38.pyc │ │ ├── 0008_auto_20210411_1110.cpython-39.pyc │ │ ├── 0009_shop_url.cpython-38.pyc │ │ ├── 0009_shop_url.cpython-39.pyc │ │ ├── __init__.cpython-38.pyc │ │ └── __init__.cpython-39.pyc ├── models.py ├── products.py ├── serializers.py ├── shops.py ├── signals.py ├── tests.py ├── urls │ ├── __pycache__ │ │ ├── order_urls.cpython-38.pyc │ │ ├── order_urls.cpython-39.pyc │ │ ├── product_urls.cpython-38.pyc │ │ ├── product_urls.cpython-39.pyc │ │ ├── shop_urls.cpython-38.pyc │ │ ├── shop_urls.cpython-39.pyc │ │ ├── user_urls.cpython-38.pyc │ │ └── user_urls.cpython-39.pyc │ ├── order_urls.py │ ├── product_urls.py │ ├── shop_urls.py │ └── user_urls.py └── views │ ├── __pycache__ │ ├── order_views.cpython-38.pyc │ ├── order_views.cpython-39.pyc │ ├── product_views.cpython-38.pyc │ ├── product_views.cpython-39.pyc │ ├── shop_views.cpython-38.pyc │ ├── shop_views.cpython-39.pyc │ ├── user_views.cpython-38.pyc │ └── user_views.cpython-39.pyc │ ├── order_views.py │ ├── product_views.py │ ├── shop_views.py │ └── user_views.py ├── db.sqlite3 ├── manage.py ├── requirements.txt └── static ├── css ├── bootstrap.min.css └── index.css └── images ├── africa.png ├── arachide.png ├── bobolos.png ├── diversity.png ├── divine.png ├── looking_shop.png ├── manioc.png ├── max.png ├── nkui.png ├── ohg.png ├── okok.png ├── palmoil.png ├── quatrecote.png ├── rondelle.png ├── s1.jpg ├── s1.png ├── s10.png ├── s11.png ├── s12.png ├── s13.png ├── s14.png ├── s15.png ├── s16.png ├── s17.png ├── s18.png ├── s19.png ├── s2.jpg ├── s2.png ├── s20.png ├── s21.png ├── s3.jpg ├── s3.png ├── s4.png ├── s5.jpg ├── s6.png ├── s7.png ├── s8.png ├── s9.png ├── shop.png ├── shop_open.png └── yam.png /backend/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/backend/__init__.py -------------------------------------------------------------------------------- /backend/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/backend/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /backend/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/backend/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /backend/__pycache__/settings.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/backend/__pycache__/settings.cpython-38.pyc -------------------------------------------------------------------------------- /backend/__pycache__/settings.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/backend/__pycache__/settings.cpython-39.pyc -------------------------------------------------------------------------------- /backend/__pycache__/urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/backend/__pycache__/urls.cpython-38.pyc -------------------------------------------------------------------------------- /backend/__pycache__/urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/backend/__pycache__/urls.cpython-39.pyc -------------------------------------------------------------------------------- /backend/__pycache__/wsgi.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/backend/__pycache__/wsgi.cpython-38.pyc -------------------------------------------------------------------------------- /backend/__pycache__/wsgi.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/backend/__pycache__/wsgi.cpython-39.pyc -------------------------------------------------------------------------------- /backend/asgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | ASGI config for backend project. 3 | 4 | It exposes the ASGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.asgi import get_asgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings') 15 | 16 | application = get_asgi_application() 17 | -------------------------------------------------------------------------------- /backend/settings.py: -------------------------------------------------------------------------------- 1 | """ 2 | Django settings for backend project. 3 | 4 | Generated by 'django-admin startproject' using Django 3.1.7. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/topics/settings/ 8 | 9 | For the full list of settings and their values, see 10 | https://docs.djangoproject.com/en/3.1/ref/settings/ 11 | """ 12 | 13 | from pathlib import Path 14 | import os 15 | 16 | # Build paths inside the project like this: BASE_DIR / 'subdir'. 17 | BASE_DIR = Path(__file__).resolve().parent.parent 18 | 19 | 20 | # Quick-start development settings - unsuitable for production 21 | # See https://docs.djangoproject.com/en/3.1/howto/deployment/checklist/ 22 | 23 | # SECURITY WARNING: keep the secret key used in production secret! 24 | SECRET_KEY = 'euxu(ix=e4ea)xqhr*2s&-8j)87mcnjx$ms!)(2ks+!y_l-y%l' 25 | 26 | # SECURITY WARNING: don't run with debug turned on in production! 27 | DEBUG = True 28 | 29 | ALLOWED_HOSTS = [] 30 | 31 | 32 | # Application definition 33 | 34 | INSTALLED_APPS = [ 35 | 'django.contrib.admin', 36 | 'django.contrib.auth', 37 | 'django.contrib.contenttypes', 38 | 'django.contrib.sessions', 39 | 'django.contrib.messages', 40 | 'django.contrib.staticfiles', 41 | 42 | 'rest_framework', 43 | 'corsheaders', 44 | 45 | 'base.apps.BaseConfig', 46 | 47 | ] 48 | 49 | REST_FRAMEWORK = { 50 | 'DEFAULT_AUTHENTICATION_CLASSES': ( 51 | 52 | 'rest_framework_simplejwt.authentication.JWTAuthentication', 53 | ) 54 | 55 | } 56 | 57 | from datetime import timedelta 58 | 59 | SIMPLE_JWT = { 60 | 'ACCESS_TOKEN_LIFETIME': timedelta(days=30), 61 | 'REFRESH_TOKEN_LIFETIME': timedelta(days=1), 62 | 'ROTATE_REFRESH_TOKENS': False, 63 | 'BLACKLIST_AFTER_ROTATION': True, 64 | 'UPDATE_LAST_LOGIN': False, 65 | 66 | 'ALGORITHM': 'HS256', 67 | 'VERIFYING_KEY': None, 68 | 'AUDIENCE': None, 69 | 'ISSUER': None, 70 | 71 | 'AUTH_HEADER_TYPES': ('Bearer',), 72 | 'AUTH_HEADER_NAME': 'HTTP_AUTHORIZATION', 73 | 'USER_ID_FIELD': 'id', 74 | 'USER_ID_CLAIM': 'user_id', 75 | 76 | 'AUTH_TOKEN_CLASSES': ('rest_framework_simplejwt.tokens.AccessToken',), 77 | 'TOKEN_TYPE_CLAIM': 'token_type', 78 | 79 | 'JTI_CLAIM': 'jti', 80 | 81 | 'SLIDING_TOKEN_REFRESH_EXP_CLAIM': 'refresh_exp', 82 | 'SLIDING_TOKEN_LIFETIME': timedelta(minutes=5), 83 | 'SLIDING_TOKEN_REFRESH_LIFETIME': timedelta(days=1), 84 | } 85 | 86 | 87 | MIDDLEWARE = [ 88 | 'corsheaders.middleware.CorsMiddleware', 89 | 90 | 91 | 'django.middleware.security.SecurityMiddleware', 92 | 'django.contrib.sessions.middleware.SessionMiddleware', 93 | 'django.middleware.common.CommonMiddleware', 94 | 'django.middleware.csrf.CsrfViewMiddleware', 95 | 'django.contrib.auth.middleware.AuthenticationMiddleware', 96 | 'django.contrib.messages.middleware.MessageMiddleware', 97 | 'django.middleware.clickjacking.XFrameOptionsMiddleware', 98 | ] 99 | 100 | ROOT_URLCONF = 'backend.urls' 101 | 102 | TEMPLATES = [ 103 | { 104 | 'BACKEND': 'django.template.backends.django.DjangoTemplates', 105 | 'DIRS': [ 106 | #os.path.join(BASE_DIR, 'frontend/build') 107 | ], 108 | 'APP_DIRS': True, 109 | 'OPTIONS': { 110 | 'context_processors': [ 111 | 'django.template.context_processors.debug', 112 | 'django.template.context_processors.request', 113 | 'django.contrib.auth.context_processors.auth', 114 | 'django.contrib.messages.context_processors.messages', 115 | ], 116 | }, 117 | }, 118 | ] 119 | 120 | WSGI_APPLICATION = 'backend.wsgi.application' 121 | 122 | 123 | # Database 124 | # https://docs.djangoproject.com/en/3.1/ref/settings/#databases 125 | 126 | DATABASES = { 127 | 'default': { 128 | 'ENGINE': 'django.db.backends.sqlite3', 129 | 'NAME': BASE_DIR / 'db.sqlite3', 130 | } 131 | } 132 | 133 | 134 | # Password validation 135 | # https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators 136 | 137 | AUTH_PASSWORD_VALIDATORS = [ 138 | { 139 | 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', 140 | }, 141 | { 142 | 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', 143 | }, 144 | { 145 | 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', 146 | }, 147 | { 148 | 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', 149 | }, 150 | ] 151 | 152 | 153 | # Internationalization 154 | # https://docs.djangoproject.com/en/3.1/topics/i18n/ 155 | 156 | LANGUAGE_CODE = 'en-us' 157 | 158 | TIME_ZONE = 'UTC' 159 | 160 | USE_I18N = True 161 | 162 | USE_L10N = True 163 | 164 | USE_TZ = True 165 | 166 | 167 | # Static files (CSS, JavaScript, Images) 168 | # https://docs.djangoproject.com/en/3.1/howto/static-files/ 169 | 170 | STATIC_URL = '/static/' 171 | MEDIA_URL = '/images/' 172 | 173 | STATICFILES_DIRS = [ 174 | BASE_DIR / 'static' 175 | #BASE_DIR / 'frontend/build/static' 176 | ] 177 | 178 | MEDIA_ROOT = 'static/images' 179 | 180 | CORS_ALLOW_ALL_ORIGINS = True 181 | -------------------------------------------------------------------------------- /backend/urls.py: -------------------------------------------------------------------------------- 1 | """backend URL Configuration 2 | 3 | The `urlpatterns` list routes URLs to views. For more information please see: 4 | https://docs.djangoproject.com/en/3.1/topics/http/urls/ 5 | Examples: 6 | Function views 7 | 1. Add an import: from my_app import views 8 | 2. Add a URL to urlpatterns: path('', views.home, name='home') 9 | Class-based views 10 | 1. Add an import: from other_app.views import Home 11 | 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') 12 | Including another URLconf 13 | 1. Import the include() function: from django.urls import include, path 14 | 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 15 | """ 16 | from django.contrib import admin 17 | from django.urls import path, include 18 | 19 | from django.conf import settings 20 | from django.conf.urls.static import static 21 | #from django.views.generic import TemplateView 22 | 23 | urlpatterns = [ 24 | path('admin/', admin.site.urls), 25 | # path('', TemplateView.as_view(template_name='index.html')), 26 | path('api/products/', include('base.urls.product_urls')), 27 | path('api/shops/', include('base.urls.shop_urls')), 28 | path('api/users/', include('base.urls.user_urls')), 29 | path('api/orders/', include('base.urls.order_urls')), 30 | 31 | ] 32 | 33 | urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) -------------------------------------------------------------------------------- /backend/wsgi.py: -------------------------------------------------------------------------------- 1 | """ 2 | WSGI config for backend project. 3 | 4 | It exposes the WSGI callable as a module-level variable named ``application``. 5 | 6 | For more information on this file, see 7 | https://docs.djangoproject.com/en/3.1/howto/deployment/wsgi/ 8 | """ 9 | 10 | import os 11 | 12 | from django.core.wsgi import get_wsgi_application 13 | 14 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings') 15 | 16 | application = get_wsgi_application() 17 | -------------------------------------------------------------------------------- /base/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/__init__.py -------------------------------------------------------------------------------- /base/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /base/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /base/__pycache__/admin.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/__pycache__/admin.cpython-38.pyc -------------------------------------------------------------------------------- /base/__pycache__/admin.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/__pycache__/admin.cpython-39.pyc -------------------------------------------------------------------------------- /base/__pycache__/apps.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/__pycache__/apps.cpython-38.pyc -------------------------------------------------------------------------------- /base/__pycache__/apps.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/__pycache__/apps.cpython-39.pyc -------------------------------------------------------------------------------- /base/__pycache__/models.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/__pycache__/models.cpython-38.pyc -------------------------------------------------------------------------------- /base/__pycache__/models.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/__pycache__/models.cpython-39.pyc -------------------------------------------------------------------------------- /base/__pycache__/products.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/__pycache__/products.cpython-39.pyc -------------------------------------------------------------------------------- /base/__pycache__/serializers.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/__pycache__/serializers.cpython-38.pyc -------------------------------------------------------------------------------- /base/__pycache__/serializers.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/__pycache__/serializers.cpython-39.pyc -------------------------------------------------------------------------------- /base/__pycache__/shops.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/__pycache__/shops.cpython-39.pyc -------------------------------------------------------------------------------- /base/__pycache__/signals.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/__pycache__/signals.cpython-38.pyc -------------------------------------------------------------------------------- /base/__pycache__/signals.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/__pycache__/signals.cpython-39.pyc -------------------------------------------------------------------------------- /base/__pycache__/urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/__pycache__/urls.cpython-39.pyc -------------------------------------------------------------------------------- /base/__pycache__/views.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/__pycache__/views.cpython-39.pyc -------------------------------------------------------------------------------- /base/admin.py: -------------------------------------------------------------------------------- 1 | from django.contrib import admin 2 | from .models import * 3 | 4 | # Register your models here. 5 | admin.site.register(Shop) 6 | admin.site.register(Product) 7 | admin.site.register(Review) 8 | admin.site.register(Review_Shop) 9 | admin.site.register(Order) 10 | admin.site.register(OrderItem) 11 | admin.site.register(ShippingAddress) 12 | 13 | -------------------------------------------------------------------------------- /base/apps.py: -------------------------------------------------------------------------------- 1 | from django.apps import AppConfig 2 | 3 | 4 | class BaseConfig(AppConfig): 5 | name = 'base' 6 | 7 | def ready(self): 8 | import base.signals 9 | -------------------------------------------------------------------------------- /base/migrations/0001_initial.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.7 on 2021-03-28 23:43 2 | 3 | from django.conf import settings 4 | from django.db import migrations, models 5 | import django.db.models.deletion 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | initial = True 11 | 12 | dependencies = [ 13 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 14 | ] 15 | 16 | operations = [ 17 | migrations.CreateModel( 18 | name='Shop', 19 | fields=[ 20 | ('name', models.CharField(blank=True, max_length=200, null=True)), 21 | ('address', models.CharField(blank=True, max_length=200, null=True)), 22 | ('postalCode', models.CharField(blank=True, max_length=200, null=True)), 23 | ('city', models.CharField(blank=True, max_length=200, null=True)), 24 | ('state', models.CharField(blank=True, max_length=200, null=True)), 25 | ('country', models.CharField(blank=True, max_length=200, null=True)), 26 | ('category', models.CharField(blank=True, max_length=200, null=True)), 27 | ('rating', models.DecimalField(blank=True, decimal_places=2, max_digits=7, null=True)), 28 | ('numReviews', models.IntegerField(blank=True, default=0, null=True)), 29 | ('description', models.TextField(blank=True, null=True)), 30 | ('hours', models.TextField(blank=True, null=True)), 31 | ('phone', models.CharField(blank=True, max_length=200, null=True)), 32 | ('createdAt', models.DateTimeField(auto_now_add=True)), 33 | ('_id', models.AutoField(editable=False, primary_key=True, serialize=False)), 34 | ], 35 | ), 36 | migrations.CreateModel( 37 | name='Product', 38 | fields=[ 39 | ('name', models.CharField(blank=True, max_length=200, null=True)), 40 | ('brand', models.CharField(blank=True, max_length=200, null=True)), 41 | ('category', models.CharField(blank=True, max_length=200, null=True)), 42 | ('description', models.TextField(blank=True, null=True)), 43 | ('rating', models.DecimalField(blank=True, decimal_places=2, max_digits=7, null=True)), 44 | ('numReviews', models.IntegerField(blank=True, default=0, null=True)), 45 | ('price', models.DecimalField(blank=True, decimal_places=2, max_digits=7, null=True)), 46 | ('countInStock', models.IntegerField(blank=True, default=0, null=True)), 47 | ('createdAt', models.DateTimeField(auto_now_add=True)), 48 | ('_id', models.AutoField(editable=False, primary_key=True, serialize=False)), 49 | ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), 50 | ], 51 | ), 52 | ] 53 | -------------------------------------------------------------------------------- /base/migrations/0002_order_orderitem_review_review_shop_shippingaddress.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.7 on 2021-03-29 00:42 2 | 3 | from django.conf import settings 4 | from django.db import migrations, models 5 | import django.db.models.deletion 6 | 7 | 8 | class Migration(migrations.Migration): 9 | 10 | dependencies = [ 11 | migrations.swappable_dependency(settings.AUTH_USER_MODEL), 12 | ('base', '0001_initial'), 13 | ] 14 | 15 | operations = [ 16 | migrations.CreateModel( 17 | name='Order', 18 | fields=[ 19 | ('paymentMethod', models.CharField(blank=True, max_length=200, null=True)), 20 | ('taxPrice', models.DecimalField(blank=True, decimal_places=2, max_digits=7, null=True)), 21 | ('shippingPrice', models.DecimalField(blank=True, decimal_places=2, max_digits=7, null=True)), 22 | ('totalPrice', models.DecimalField(blank=True, decimal_places=2, max_digits=7, null=True)), 23 | ('isPaid', models.BooleanField(default=False)), 24 | ('paidAt', models.DateTimeField(blank=True, null=True)), 25 | ('isDelivered', models.BooleanField(default=False)), 26 | ('deliveredAt', models.DateTimeField(blank=True, null=True)), 27 | ('createdAt', models.DateTimeField(auto_now_add=True)), 28 | ('_id', models.AutoField(editable=False, primary_key=True, serialize=False)), 29 | ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), 30 | ], 31 | ), 32 | migrations.CreateModel( 33 | name='ShippingAddress', 34 | fields=[ 35 | ('address', models.CharField(blank=True, max_length=200, null=True)), 36 | ('city', models.CharField(blank=True, max_length=200, null=True)), 37 | ('postalCode', models.CharField(blank=True, max_length=200, null=True)), 38 | ('country', models.CharField(blank=True, max_length=200, null=True)), 39 | ('shippingPrice', models.DecimalField(blank=True, decimal_places=2, max_digits=7, null=True)), 40 | ('_id', models.AutoField(editable=False, primary_key=True, serialize=False)), 41 | ('order', models.OneToOneField(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='base.order')), 42 | ], 43 | ), 44 | migrations.CreateModel( 45 | name='Review_Shop', 46 | fields=[ 47 | ('name', models.CharField(blank=True, max_length=200, null=True)), 48 | ('rating', models.IntegerField(blank=True, default=0, null=True)), 49 | ('comment', models.TextField(blank=True, null=True)), 50 | ('createdAt', models.DateTimeField(auto_now_add=True)), 51 | ('_id', models.AutoField(editable=False, primary_key=True, serialize=False)), 52 | ('shop', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='base.product')), 53 | ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), 54 | ], 55 | ), 56 | migrations.CreateModel( 57 | name='Review', 58 | fields=[ 59 | ('name', models.CharField(blank=True, max_length=200, null=True)), 60 | ('rating', models.IntegerField(blank=True, default=0, null=True)), 61 | ('comment', models.TextField(blank=True, null=True)), 62 | ('createdAt', models.DateTimeField(auto_now_add=True)), 63 | ('_id', models.AutoField(editable=False, primary_key=True, serialize=False)), 64 | ('product', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='base.product')), 65 | ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)), 66 | ], 67 | ), 68 | migrations.CreateModel( 69 | name='OrderItem', 70 | fields=[ 71 | ('name', models.CharField(blank=True, max_length=200, null=True)), 72 | ('qty', models.IntegerField(blank=True, default=0, null=True)), 73 | ('price', models.DecimalField(blank=True, decimal_places=2, max_digits=7, null=True)), 74 | ('image', models.CharField(blank=True, max_length=200, null=True)), 75 | ('_id', models.AutoField(editable=False, primary_key=True, serialize=False)), 76 | ('order', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='base.order')), 77 | ('product', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='base.product')), 78 | ], 79 | ), 80 | ] 81 | -------------------------------------------------------------------------------- /base/migrations/0003_shop_image.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.7 on 2021-03-29 00:47 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('base', '0002_order_orderitem_review_review_shop_shippingaddress'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='shop', 15 | name='image', 16 | field=models.ImageField(blank=True, null=True, upload_to=''), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /base/migrations/0004_product_image.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.7 on 2021-03-29 14:17 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('base', '0003_shop_image'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='product', 15 | name='image', 16 | field=models.ImageField(blank=True, default='/placeholder.png', null=True, upload_to=''), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /base/migrations/0005_auto_20210405_1103.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.7 on 2021-04-05 09:03 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('base', '0004_product_image'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AlterField( 14 | model_name='shop', 15 | name='image', 16 | field=models.ImageField(blank=True, default='/placeholder.png', null=True, upload_to=''), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /base/migrations/0006_auto_20210411_1003.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.7 on 2021-04-11 08:03 2 | 3 | from django.db import migrations, models 4 | import django.db.models.deletion 5 | 6 | 7 | class Migration(migrations.Migration): 8 | 9 | dependencies = [ 10 | ('base', '0005_auto_20210405_1103'), 11 | ] 12 | 13 | operations = [ 14 | migrations.AlterField( 15 | model_name='review_shop', 16 | name='shop', 17 | field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='base.shop'), 18 | ), 19 | ] 20 | -------------------------------------------------------------------------------- /base/migrations/0007_auto_20210411_1038.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.7 on 2021-04-11 08:38 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('base', '0006_auto_20210411_1003'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameField( 14 | model_name='review_shop', 15 | old_name='comment', 16 | new_name='comment_shop', 17 | ), 18 | migrations.RenameField( 19 | model_name='review_shop', 20 | old_name='rating', 21 | new_name='rating_shop', 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /base/migrations/0008_auto_20210411_1110.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.7 on 2021-04-11 09:10 2 | 3 | from django.db import migrations 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('base', '0007_auto_20210411_1038'), 10 | ] 11 | 12 | operations = [ 13 | migrations.RenameField( 14 | model_name='review_shop', 15 | old_name='comment_shop', 16 | new_name='comment', 17 | ), 18 | migrations.RenameField( 19 | model_name='review_shop', 20 | old_name='rating_shop', 21 | new_name='rating', 22 | ), 23 | ] 24 | -------------------------------------------------------------------------------- /base/migrations/0009_shop_url.py: -------------------------------------------------------------------------------- 1 | # Generated by Django 3.1.7 on 2021-04-15 19:23 2 | 3 | from django.db import migrations, models 4 | 5 | 6 | class Migration(migrations.Migration): 7 | 8 | dependencies = [ 9 | ('base', '0008_auto_20210411_1110'), 10 | ] 11 | 12 | operations = [ 13 | migrations.AddField( 14 | model_name='shop', 15 | name='url', 16 | field=models.CharField(blank=True, max_length=200, null=True), 17 | ), 18 | ] 19 | -------------------------------------------------------------------------------- /base/migrations/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__init__.py -------------------------------------------------------------------------------- /base/migrations/__pycache__/0001_initial.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/0001_initial.cpython-38.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/0001_initial.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/0001_initial.cpython-39.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/0002_order_orderitem_review_review_shop_shippingaddress.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/0002_order_orderitem_review_review_shop_shippingaddress.cpython-38.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/0002_order_orderitem_review_review_shop_shippingaddress.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/0002_order_orderitem_review_review_shop_shippingaddress.cpython-39.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/0003_shop_image.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/0003_shop_image.cpython-38.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/0003_shop_image.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/0003_shop_image.cpython-39.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/0004_product_image.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/0004_product_image.cpython-38.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/0004_product_image.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/0004_product_image.cpython-39.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/0005_auto_20210405_1103.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/0005_auto_20210405_1103.cpython-38.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/0005_auto_20210405_1103.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/0005_auto_20210405_1103.cpython-39.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/0006_auto_20210411_1003.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/0006_auto_20210411_1003.cpython-38.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/0006_auto_20210411_1003.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/0006_auto_20210411_1003.cpython-39.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/0007_auto_20210411_1038.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/0007_auto_20210411_1038.cpython-38.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/0007_auto_20210411_1038.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/0007_auto_20210411_1038.cpython-39.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/0008_auto_20210411_1110.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/0008_auto_20210411_1110.cpython-38.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/0008_auto_20210411_1110.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/0008_auto_20210411_1110.cpython-39.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/0009_shop_url.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/0009_shop_url.cpython-38.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/0009_shop_url.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/0009_shop_url.cpython-39.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/__init__.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/__init__.cpython-38.pyc -------------------------------------------------------------------------------- /base/migrations/__pycache__/__init__.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/migrations/__pycache__/__init__.cpython-39.pyc -------------------------------------------------------------------------------- /base/models.py: -------------------------------------------------------------------------------- 1 | from django.db import models 2 | from django.contrib.auth.models import User 3 | 4 | 5 | # Create your models here. 6 | 7 | class Product(models.Model): 8 | user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True) 9 | name = models.CharField(max_length=200, null=True, blank=True) 10 | image = models.ImageField(null=True, blank=True, default='/placeholder.png') 11 | brand = models.CharField(max_length=200, null=True, blank=True) 12 | category = models.CharField(max_length=200, null=True, blank=True) 13 | description = models.TextField(null=True, blank=True) 14 | rating = models.DecimalField(max_digits=7, decimal_places=2, null=True, blank=True) 15 | numReviews = models.IntegerField(null=True, blank=True, default=0) 16 | price = models.DecimalField( max_digits=7, decimal_places=2, null=True, blank=True) 17 | countInStock = models.IntegerField(null=True, blank=True, default=0) 18 | createdAt = models.DateTimeField(auto_now_add=True) 19 | _id = models.AutoField(primary_key=True, editable=False) 20 | 21 | def __str__(self): 22 | return self.name 23 | 24 | class Review(models.Model): 25 | product = models.ForeignKey(Product, on_delete=models.SET_NULL, null=True) 26 | user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True) 27 | name = models.CharField(max_length=200, null=True, blank=True) 28 | rating = models.IntegerField(null=True, blank=True, default=0) 29 | comment = models.TextField(null=True, blank=True) 30 | createdAt = models.DateTimeField(auto_now_add=True) 31 | _id = models.AutoField(primary_key=True, editable=False) 32 | 33 | def __str__(self): 34 | return str(self.rating) 35 | 36 | 37 | 38 | class Shop(models.Model): 39 | name = models.CharField(max_length=200, null=True, blank=True) 40 | image = models.ImageField(null=True, blank=True, default='/placeholder.png') 41 | address = models.CharField(max_length=200, null=True, blank=True) 42 | postalCode = models.CharField(max_length=200, null=True, blank=True) 43 | city = models.CharField(max_length=200, null=True, blank=True) 44 | state = models.CharField(max_length=200, null=True, blank=True) 45 | country = models.CharField(max_length=200, null=True, blank=True) 46 | category = models.CharField(max_length=200, null=True, blank=True) 47 | rating = models.DecimalField(max_digits=7, decimal_places=2, null=True, blank=True) 48 | numReviews = models.IntegerField(null=True, blank=True, default=0) 49 | description = models.TextField(null=True, blank=True) 50 | hours = models.TextField(null=True, blank=True) 51 | phone = models.CharField(max_length=200, null=True, blank=True) 52 | url = models.CharField(max_length=200, null=True, blank=True) 53 | createdAt = models.DateTimeField(auto_now_add=True) 54 | _id = models.AutoField(primary_key=True, editable=False) 55 | 56 | def __str__(self): 57 | return self.name 58 | 59 | class Review_Shop(models.Model): 60 | shop = models.ForeignKey(Shop, on_delete=models.SET_NULL, null=True) 61 | user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True) 62 | name = models.CharField(max_length=200, null=True, blank=True) 63 | rating = models.IntegerField(null=True, blank=True, default=0) 64 | comment = models.TextField(null=True, blank=True) 65 | createdAt = models.DateTimeField(auto_now_add=True) 66 | _id = models.AutoField(primary_key=True, editable=False) 67 | 68 | def __str__(self): 69 | return str(self.rating) 70 | 71 | 72 | 73 | 74 | class Order(models.Model): 75 | user = models.ForeignKey(User, on_delete=models.SET_NULL, null=True) 76 | paymentMethod = models.CharField(max_length=200, null=True, blank=True) 77 | taxPrice = models.DecimalField(max_digits=7, decimal_places=2, null=True, blank=True) 78 | shippingPrice = models.DecimalField(max_digits=7, decimal_places=2, null=True, blank=True) 79 | totalPrice = models.DecimalField(max_digits=7, decimal_places=2, null=True, blank=True) 80 | isPaid = models.BooleanField(default=False) 81 | paidAt = models.DateTimeField(auto_now_add=False, null=True, blank=True) 82 | isDelivered = models.BooleanField(default=False) 83 | deliveredAt = models.DateTimeField(auto_now_add=False, null=True, blank=True) 84 | createdAt = models.DateTimeField(auto_now_add=True) 85 | _id = models.AutoField(primary_key=True, editable=False) 86 | 87 | def __str__(self): 88 | return str(self.createdAt) 89 | 90 | 91 | 92 | class OrderItem(models.Model): 93 | product = models.ForeignKey(Product, on_delete=models.SET_NULL, null=True) 94 | order = models.ForeignKey(Order, on_delete=models.SET_NULL, null=True) 95 | name = models.CharField(max_length=200, null=True, blank=True) 96 | qty = models.IntegerField(null=True, blank=True, default=0) 97 | price = models.DecimalField(max_digits=7, decimal_places=2, null=True, blank=True) 98 | image = models.CharField(max_length=200, null=True, blank=True) 99 | _id = models.AutoField(primary_key=True, editable=False) 100 | 101 | def __str__(self): 102 | return str(self.name) 103 | 104 | 105 | 106 | class ShippingAddress(models.Model): 107 | order = models.OneToOneField(Order, on_delete=models.CASCADE, null=True, blank=True) 108 | address = models.CharField(max_length=200, null=True, blank=True) 109 | city = models.CharField(max_length=200, null=True, blank=True) 110 | postalCode = models.CharField(max_length=200, null=True, blank=True) 111 | country = models.CharField(max_length=200, null=True, blank=True) 112 | shippingPrice = models.DecimalField(max_digits=7, decimal_places=2, null=True, blank=True) 113 | _id = models.AutoField(primary_key=True, editable=False) 114 | 115 | def __str__(self): 116 | return str(self.address) -------------------------------------------------------------------------------- /base/products.py: -------------------------------------------------------------------------------- 1 | products = [ 2 | { 3 | '_id': '1', 4 | 'name': 'Bobolo', 5 | 'image': '/images/Bobolo.png', 6 | 'brand': 'AfroShopMe', 7 | 'category': 'Tubercules', 8 | 'description':'No description for now - Coming soon!', 9 | 'rating': 4.5, 10 | 'numReviews': 10, 11 | 'price': 4.50, 12 | 'countInStock': 10, 13 | }, 14 | { 15 | '_id': '2', 16 | 'name': 'Cacahuètes', 17 | 'image': '/images/arachide.png', 18 | 'brand': 'AfroShopMe', 19 | 'category': 'Arachides', 20 | 'description':'No description for now - Coming soon!', 21 | 'rating': 2.5, 22 | 'numReviews': 3, 23 | 'price': 4.50, 24 | 'countInStock': 10, 25 | }, 26 | { 27 | '_id': '3', 28 | 'name': 'Tubercules de Manioc', 29 | 'image': '/images/manioc.png', 30 | 'brand': 'AfroShopMe', 31 | 'category': 'Tubercules', 32 | 'description':'No description for now - Coming soon!', 33 | 'rating': 4.5, 34 | 'numReviews': 11, 35 | 'price': 4.50, 36 | 'countInStock': 10, 37 | }, 38 | { 39 | '_id': '4', 40 | 'name': 'Nkui', 41 | 'image': '/images/nkui.png', 42 | 'brand': 'AfroShopMe', 43 | 'category': 'Epices', 44 | 'description':'No description for now - Coming soon!', 45 | 'rating': 4.0, 46 | 'numReviews': 21, 47 | 'price': 4.50, 48 | 'countInStock': 10, 49 | }, 50 | { 51 | '_id': '5', 52 | 'name': 'Okok', 53 | 'image': '/images/okok.png', 54 | 'brand': 'AfroShopMe', 55 | 'category': 'Legumes', 56 | 'description':'No description for now - Coming soon!', 57 | 'rating': 5.0, 58 | 'numReviews': 13, 59 | 'price': 4.50, 60 | 'countInStock': 10, 61 | }, 62 | { 63 | '_id': '6', 64 | 'name': 'Huile de palme', 65 | 'image': '/images/palmoil.png', 66 | 'brand': 'AfroShopMe', 67 | 'category': 'Liquides', 68 | 'description':'No description for now - Coming soon!', 69 | 'rating': 4.0, 70 | 'numReviews': 18, 71 | 'price': 4.50, 72 | 'countInStock': 10, 73 | }, 74 | { 75 | '_id': '7', 76 | 'name': '4 Côtés', 77 | 'image': '/images/tetrapleura.png', 78 | 'brand': 'AfroShopMe', 79 | 'category': 'Epices', 80 | 'description':'No description for now - Coming soon!', 81 | 'rating': 4.0, 82 | 'numReviews': 2, 83 | 'price': 4.50, 84 | 'countInStock': 10, 85 | }, 86 | { 87 | '_id': '8', 88 | 'name': 'Igname', 89 | 'image': '/images/yam.png', 90 | 'brand': 'AfroShopMe', 91 | 'category': 'Tubercules', 92 | 'description':'No description for now - Coming soon!', 93 | 'rating': 4.5, 94 | 'numReviews': 15, 95 | 'price': 4.50, 96 | 'countInStock': 10, 97 | }, 98 | { 99 | '_id': '9', 100 | 'name': 'Rondelles', 101 | 'image': '/images/rondelle.png', 102 | 'brand': 'AfroShopMe', 103 | 'category': 'Epices', 104 | 'description':'No description for now - Coming soon!', 105 | 'rating': 3.5, 106 | 'numReviews': 20, 107 | 'price': 4.50, 108 | 'countInStock': 150, 109 | }, 110 | ] 111 | 112 | -------------------------------------------------------------------------------- /base/serializers.py: -------------------------------------------------------------------------------- 1 | from rest_framework import serializers 2 | from django.contrib.auth.models import User 3 | from rest_framework_simplejwt.tokens import RefreshToken 4 | from .models import Shop, Product, User, Order, OrderItem, ShippingAddress, Review, Review_Shop 5 | 6 | 7 | # UserSerializer 8 | class UserSerializer(serializers.ModelSerializer): 9 | name = serializers.SerializerMethodField(read_only=True) 10 | _id = serializers.SerializerMethodField(read_only=True) 11 | isAdmin = serializers.SerializerMethodField(read_only=True) 12 | 13 | class Meta: 14 | model = User 15 | fields = ['id', '_id', 'username', 'email', 'name', 'isAdmin'] 16 | 17 | def get__id(self, obj): 18 | return obj.id 19 | 20 | 21 | def get_isAdmin(self, obj): 22 | return obj.is_staff 23 | 24 | def get_name(self, obj): 25 | name = obj.first_name 26 | if name == '': 27 | name = obj.email 28 | 29 | return name 30 | 31 | # UserSerializerWithToken 32 | class UserSerializerWithToken(UserSerializer): 33 | token = serializers.SerializerMethodField(read_only=True) 34 | class Meta: 35 | model = User 36 | fields = ['id', '_id', 'username', 'email', 'name', 'isAdmin', 'token'] 37 | 38 | def get_token(self, obj): 39 | token = RefreshToken.for_user(obj) 40 | return str(token.access_token) 41 | 42 | ######################################################################### 43 | # ProductSerializer 44 | class ProductSerializer(serializers.ModelSerializer): 45 | reviews = serializers.SerializerMethodField(read_only=True) 46 | 47 | class Meta: 48 | model = Product 49 | fields = '__all__' 50 | 51 | def get_reviews(self, obj): 52 | reviews = obj.review_set.all() 53 | serializer = ReviewSerializer(reviews, many=True) 54 | return serializer.data 55 | 56 | 57 | ############ ############# 58 | 59 | # ShopSerializer 60 | class ShopSerializer(serializers.ModelSerializer): 61 | reviews = serializers.SerializerMethodField(read_only=True) 62 | 63 | class Meta: 64 | model = Shop 65 | fields = '__all__' 66 | 67 | def get_reviews(self, obj): 68 | reviews = obj.review_shop_set.all() 69 | serializer = Review_ShopSerializer(reviews, many=True) 70 | return serializer.data 71 | 72 | ############################################################################ 73 | 74 | # ReviewSerializer 75 | class ReviewSerializer(serializers.ModelSerializer): 76 | class Meta: 77 | model = Review 78 | fields = '__all__' 79 | 80 | 81 | # Review_ShopSerializer 82 | class Review_ShopSerializer(serializers.ModelSerializer): 83 | class Meta: 84 | model = Review_Shop 85 | fields = '__all__' 86 | 87 | ############################################################################### 88 | 89 | 90 | # ShippingAddressSerializer 91 | class ShippingAddressSerializer(serializers.ModelSerializer): 92 | class Meta: 93 | model = ShippingAddress 94 | fields = '__all__' 95 | 96 | 97 | # OrderItemSerializer 98 | class OrderItemSerializer(serializers.ModelSerializer): 99 | class Meta: 100 | model = OrderItem 101 | fields = '__all__' 102 | 103 | 104 | # OrderSerializer 105 | class OrderSerializer(serializers.ModelSerializer): 106 | orderItems = serializers.SerializerMethodField(read_only=True) 107 | shippingAddress = serializers.SerializerMethodField(read_only=True) 108 | user = serializers.SerializerMethodField(read_only=True) 109 | 110 | class Meta: 111 | model = Order 112 | fields = '__all__' 113 | 114 | def get_orderItems(self, obj): 115 | items = obj.orderitem_set.all() 116 | serializer = OrderItemSerializer(items, many=True) 117 | return serializer.data 118 | 119 | def get_shippingAddress(self, obj): 120 | try: 121 | address = ShippingAddressSerializer( 122 | obj.shippingaddress, many=False).data 123 | except: 124 | address = False 125 | return address 126 | 127 | def get_user(self, obj): 128 | user = obj.user 129 | serializer = UserSerializer(user, many=False) 130 | return serializer.data 131 | ################################################################################ -------------------------------------------------------------------------------- /base/shops.py: -------------------------------------------------------------------------------- 1 | shops = [ 2 | { 3 | '_id': '1', 4 | 'name': 'Afro Shop Iman', 5 | 'image': '/images/bg_1.jpg', 6 | 'address': 'Vorstadtstr. 33', 7 | 'postalCode': '66117', 8 | 'city': 'Saarbrücken', 9 | 'state': 'Saarland', 10 | 'country': 'Deutschland', 11 | 'category': 'AfroShop', 12 | 'rating': 4.5, 13 | 'numReviews': 1, 14 | 'description':'No description for now - Coming soon!', 15 | 'hours': 'Mo - Sa : 10.00 - 20.00 Uhr', 16 | 'phone': '0681-9703917', 17 | }, 18 | { 19 | '_id': '2', 20 | 'name': 'Afro Shop Dafrob', 21 | 'image': '/images/bg_2.jpg', 22 | 'address': 'Hüttenstr. 5', 23 | 'city': 'Neuenkirchen', 24 | 'state': 'Saarland', 25 | 'postalCode': '66538', 26 | 'country': 'Deutschland', 27 | 'category': 'AfroShop', 28 | 'rating': 4.0, 29 | 'numReviews': 2, 30 | 'description':'No description for now - Coming soon!', 31 | 'hours': 'Mo - Sa : 10.00 - 20.00 Uhr', 32 | 'phone': '017670787794', 33 | }, 34 | { 35 | '_id': '3', 36 | 'name': 'Bobby Afro Shop', 37 | 'image': '/images/bg_3.jpg', 38 | 'address': 'Bergstraße 61', 39 | 'city': 'Saarbrücken', 40 | 'state': 'Saarland', 41 | 'postalCode': '66115 ', 42 | 'country': 'Deutschland', 43 | 'category': 'AfroShop', 44 | 'rating': 3.0, 45 | 'numReviews': 5, 46 | 'description':'No description for now - Coming soon!', 47 | 'hours': 'Mo - Sa : 10.00 - 20.00 Uhr', 48 | 'phone': '06819977239', 49 | }, 50 | { 51 | '_id': '4', 52 | 'name': 'Gye Nyame Afro Shop', 53 | 'image': '/images/bg_4.png', 54 | 'address': 'Klausenerstraße 20', 55 | 'city': 'Saarbrücken', 56 | 'state': 'Saarland', 57 | 'postalCode': '66115 ', 58 | 'country': 'Deutschland', 59 | 'category': 'AfroShop', 60 | 'rating': 4.0, 61 | 'numReviews': 2, 62 | 'description':'No description for now - Coming soon!', 63 | 'hours': 'Mo - Sa : 10.00 - 20.00 Uhr', 64 | 'phone': '068193556245', 65 | }, 66 | { 67 | '_id': '5', 68 | 'name': 'Linas Afro Shop', 69 | 'image': '/images/bg_5.jpg', 70 | 'address': 'Johannisstr. 31', 71 | 'city': 'Saarbrücken ', 72 | 'state': 'Saarland', 73 | 'postalCode': '66111 ', 74 | 'country': 'Deutschland', 75 | 'category': 'AfroShop', 76 | 'rating': 2.0, 77 | 'numReviews': 2, 78 | 'description':'No description for now - Coming soon!', 79 | 'hours': 'Mo - Sa : 10.00 - 20.00 Uhr', 80 | 'phone': 'Telefon nicht bekannt', 81 | }, 82 | { 83 | '_id': '6', 84 | 'name': 'Afro Shop Tropicana', 85 | 'image': '/images/bg_6.png', 86 | 'address': 'Berliner Promenade 17', 87 | 'city': 'Saarbrücken', 88 | 'state': 'Saarland', 89 | 'postalCode': '66111 ', 90 | 'country': 'Deutschland', 91 | 'category': 'AfroShop', 92 | 'rating': 3.5, 93 | 'numReviews': 12, 94 | 'description':'No description for now - Coming soon!', 95 | 'hours': 'Mo - Sa : 10.00 - 20.00 Uhr', 96 | 'phone': '068137996148', 97 | }, 98 | { 99 | '_id': '7', 100 | 'name': 'Melanies AfroShop', 101 | 'image': '/images/bg_7.png', 102 | 'address': 'Karcherstraße 23', 103 | 'city': 'Saarlouis', 104 | 'state': 'Saarland', 105 | 'postalCode': '66740 ', 106 | 'country': 'Deutschland', 107 | 'category': 'AfroShop', 108 | 'rating': 4.0, 109 | 'numReviews': 2, 110 | 'description':'No description for now - Coming soon!', 111 | 'hours': 'Mo - Sa : 10.00 - 20.00 Uhr', 112 | 'phone': '068318906992', 113 | }, 114 | { 115 | '_id': '8', 116 | 'name': 'Alpha & Omega Int.', 117 | 'image': '/images/bg_8.png', 118 | 'address': 'Weserstr. 3-4 ', 119 | 'city': 'Berlin ', 120 | 'state': 'Berlin ', 121 | 'postalCode': '12047 ', 122 | 'country': 'Deutschland', 123 | 'category': 'AfroShop', 124 | 'rating': 4.0, 125 | 'numReviews': 2, 126 | 'description':'No description for now - Coming soon!', 127 | 'hours': 'Mo - Sa : 10.00 - 20.00 Uhr', 128 | 'phone': '03061624972', 129 | }, 130 | { 131 | '_id': '9', 132 | 'name': 'Afro By Mary', 133 | 'image': '/images/bg_9.png', 134 | 'address': 'Zingster str 20', 135 | 'city': 'Berlin', 136 | 'state': 'Berlin', 137 | 'postalCode': '13051', 138 | 'country': 'Deutschland', 139 | 'category': 'AfroShop', 140 | 'rating': 1.0, 141 | 'numReviews': 1, 142 | 'description':'No description for now - Coming soon!', 143 | 'hours': 'Online', 144 | 'phone': '01734594121', 145 | }, 146 | { 147 | '_id': '10', 148 | 'name': 'Afrika Vitrine', 149 | 'image': '/images/bg_10.png', 150 | 'address': 'Potsdamer Str. 156', 151 | 'city': 'Berlin–Schöneberg', 152 | 'state': 'Berlin', 153 | 'postalCode': '10783 ', 154 | 'country': 'Deutschland', 155 | 'category': 'AfroShop', 156 | 'rating': 2.0, 157 | 'numReviews': 2, 158 | 'description':'No description for now - Coming soon!', 159 | 'hours': 'Mo - Sa : 10.00 - 20.00 Uhr', 160 | 'phone': 'Telefon nicht bekannt', 161 | }, 162 | { 163 | '_id': '11', 164 | 'name': 'Asia & Afro Shop', 165 | 'image': '/images/bg_11.png', 166 | 'address': 'Leykestr. 1', 167 | 'city': 'Berlin–Neukölln', 168 | 'state': 'Berlin', 169 | 'postalCode': '12053 ', 170 | 'country': 'Deutschland', 171 | 'category': 'AfroShop', 172 | 'rating': 3.0, 173 | 'numReviews': 3, 174 | 'description':'No description for now - Coming soon!', 175 | 'hours': 'Mo - Sa : 10.00 - 20.00 Uhr', 176 | 'phone': 'Telefon nicht bekannt', 177 | }, 178 | { 179 | '_id': '12', 180 | 'name': 'Chriskes Afro Shop', 181 | 'image': '/images/bg_12.png', 182 | 'address': 'Rheinstraße 69', 183 | 'city': 'Wiesbaden', 184 | 'state': 'Hessen', 185 | 'postalCode': '65185', 186 | 'country': 'Deutschland', 187 | 'category': 'AfroShop', 188 | 'rating': 2.5, 189 | 'numReviews': 1, 190 | 'description':'No description for now - Coming soon!', 191 | 'hours': 'Mo - Sa : 09.00 - 20.00 Uhr', 192 | 'phone': '061118171740', 193 | }, 194 | { 195 | '_id': '13', 196 | 'name': 'African Bazaar', 197 | 'image': '/images/bg_13.png', 198 | 'address': 'Mainzer Landstraße 107', 199 | 'city': 'Frankfurt am Main', 200 | 'state': 'Hessen', 201 | 'postalCode': '60329 ', 202 | 'country': 'Deutschland', 203 | 'category': 'AfroShop', 204 | 'rating': 4.5, 205 | 'numReviews': 1, 206 | 'description':'No description for now - Coming soon!', 207 | 'hours': 'Mo - Sa : 09.00 - 20.00 Uhr', 208 | 'phone': '069259488', 209 | }, 210 | { 211 | '_id': '14', 212 | 'name': 'African Shop', 213 | 'image': '/images/bg_14.png', 214 | 'address': 'Wiesenhüttenstraße 39', 215 | 'city': 'Frankfurt am Main', 216 | 'state': 'Hessen', 217 | 'postalCode': '60329', 218 | 'country': 'Deutschland', 219 | 'category': 'AfroShop', 220 | 'rating': 1.5, 221 | 'numReviews': 5, 222 | 'description':'No description for now - Coming soon!', 223 | 'hours': 'Mo - Sa : 10.00 - 20.00 Uhr', 224 | 'phone': '06926010327', 225 | }, 226 | { 227 | '_id': '15', 228 | 'name': 'Kaneshie African Shop', 229 | 'image': '/images/bg_15.png', 230 | 'address': 'Moselstraße 51', 231 | 'city': 'Frankfurt am Main', 232 | 'state': 'Hessen', 233 | 'postalCode': '60329', 234 | 'country': 'Deutschland', 235 | 'category': 'AfroShop', 236 | 'rating': 2.5, 237 | 'numReviews': 1, 238 | 'description':'No description for now - Coming soon!', 239 | 'hours': 'Mo - Sa : 09.30 - 20.00 Uhr', 240 | 'phone': '03053606308', 241 | }, 242 | { 243 | '_id': '16', 244 | 'name': 'Afro Shop Fouta', 245 | 'image': '/images/bg_16.png', 246 | 'address': 'Oestermärsch 25', 247 | 'city': 'Dortmund', 248 | 'state': 'NRW', 249 | 'postalCode': '44145', 250 | 'country': 'Deutschland', 251 | 'category': 'AfroShop', 252 | 'rating': 5.0, 253 | 'numReviews': 1, 254 | 'description':'No description for now - Coming soon!', 255 | 'hours': 'Mo - Sa : 11.00 - 21.00 Uhr', 256 | 'phone': '023153098523', 257 | }, 258 | { 259 | '_id': '17', 260 | 'name': 'Afro World DO.', 261 | 'image': '/images/bg_16.png', 262 | 'address': 'Borsigstraße. 62', 263 | 'city': 'Dortmund', 264 | 'state': 'NRW', 265 | 'postalCode': '44145', 266 | 'country': 'Deutschland', 267 | 'category': 'AfroShop', 268 | 'rating': 2.0, 269 | 'numReviews': 13, 270 | 'description':'No description for now - Coming soon!', 271 | 'hours': 'Mo - Sa : 10.00 - 20.00 Uhr', 272 | 'phone': '02314759235', 273 | }, 274 | { 275 | '_id': '18', 276 | 'name': 'Max Afroshop', 277 | 'image': '/images/bg_16.png', 278 | 'address': 'Gnadenort 11', 279 | 'city': 'Dortmund', 280 | 'state': 'NRW', 281 | 'postalCode': '44135', 282 | 'country': 'Deutschland', 283 | 'category': 'AfroShop', 284 | 'rating': 5.0, 285 | 'numReviews': 1, 286 | 'description':'No description for now - Coming soon!', 287 | 'hours': 'Mo - Sa : 10.00 - 21.00 Uhr', 288 | 'phone': '02312063967', 289 | }, 290 | ] 291 | 292 | -------------------------------------------------------------------------------- /base/signals.py: -------------------------------------------------------------------------------- 1 | from django.db.models.signals import pre_save 2 | from django.contrib.auth.models import User 3 | 4 | 5 | def updateUser(sender, instance, **kwargs): 6 | user = instance 7 | if user.email != '': 8 | user.username = user.email 9 | 10 | 11 | pre_save.connect(updateUser, sender=User) 12 | -------------------------------------------------------------------------------- /base/tests.py: -------------------------------------------------------------------------------- 1 | from django.test import TestCase 2 | 3 | # Create your tests here. 4 | -------------------------------------------------------------------------------- /base/urls/__pycache__/order_urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/urls/__pycache__/order_urls.cpython-38.pyc -------------------------------------------------------------------------------- /base/urls/__pycache__/order_urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/urls/__pycache__/order_urls.cpython-39.pyc -------------------------------------------------------------------------------- /base/urls/__pycache__/product_urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/urls/__pycache__/product_urls.cpython-38.pyc -------------------------------------------------------------------------------- /base/urls/__pycache__/product_urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/urls/__pycache__/product_urls.cpython-39.pyc -------------------------------------------------------------------------------- /base/urls/__pycache__/shop_urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/urls/__pycache__/shop_urls.cpython-38.pyc -------------------------------------------------------------------------------- /base/urls/__pycache__/shop_urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/urls/__pycache__/shop_urls.cpython-39.pyc -------------------------------------------------------------------------------- /base/urls/__pycache__/user_urls.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/urls/__pycache__/user_urls.cpython-38.pyc -------------------------------------------------------------------------------- /base/urls/__pycache__/user_urls.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/urls/__pycache__/user_urls.cpython-39.pyc -------------------------------------------------------------------------------- /base/urls/order_urls.py: -------------------------------------------------------------------------------- 1 | # Connect the views to urls 2 | 3 | from django.urls import path 4 | from base.views import order_views as views # same folder just "." 5 | 6 | 7 | urlpatterns = [ 8 | 9 | path('', views.getOrders, name='orders'), 10 | path('add/', views.addOrderItems, name='orders-add'), 11 | path('myorders/', views.getMyOrders, name='myorders'), 12 | 13 | path('/deliver/', views.updateOrderToDelivered, name='order-delivered'), 14 | 15 | path('/', views.getOrderById, name='user-order'), 16 | path('/pay/', views.updateOrderToPaid, name='pay'), 17 | ] 18 | 19 | -------------------------------------------------------------------------------- /base/urls/product_urls.py: -------------------------------------------------------------------------------- 1 | # Connect the views to urls 2 | 3 | from django.urls import path 4 | from base.views import product_views as views # same folder just "." 5 | 6 | 7 | urlpatterns = [ 8 | 9 | path('', views.getProducts, name="products"), 10 | 11 | path('create/', views.createProduct, name="product-create"), 12 | path('upload/', views.uploadImage, name="image-upload"), 13 | 14 | path('/reviews/', views.createProductReview, name="create-review"), 15 | path('top/', views.getTopProducts, name='top-products'), 16 | path('/', views.getProduct, name="product"), 17 | 18 | path('update//', views.updateProduct, name="product-update"), 19 | path('delete//', views.deleteProduct, name="product-delete"), 20 | ] 21 | 22 | 23 | -------------------------------------------------------------------------------- /base/urls/shop_urls.py: -------------------------------------------------------------------------------- 1 | # Connect the views to urls 2 | 3 | from django.urls import path 4 | from base.views import shop_views as views # same folder just "." 5 | 6 | 7 | urlpatterns = [ 8 | 9 | path('', views.getShops, name="shops"), 10 | path('/', views.getShop, name="shop"), 11 | 12 | # path('create_shop/', views.createShop, name="shop-create"), 13 | path('top_shop/', views.getTopShops, name='top-shops'), 14 | # path('upload_shop/', views.uploadImage, name="image-upload"), 15 | 16 | path('/reviews_shop/', views.createShopReview, name="create-review_shop"), 17 | 18 | #path('update_shop//', views.updateShop, name="shop-update"), 19 | #path('delete_shop//', views.deleteShop, name="shop-delete"), 20 | ] 21 | 22 | 23 | -------------------------------------------------------------------------------- /base/urls/user_urls.py: -------------------------------------------------------------------------------- 1 | # Connect the views to urls 2 | 3 | from django.urls import path 4 | from base.views import user_views as views # same folder just "." 5 | 6 | 7 | urlpatterns = [ 8 | path('login_client/', views.MyTokenObtainPairView.as_view(), 9 | name='token_obtain_pair'), 10 | 11 | path('register/', views.registerUser, name="register"), 12 | 13 | path('profile/', views.getUserProfile, name="users-profile"), 14 | path('profile/update/', views.updateUserProfile, name="user-profile-update"), 15 | path('', views.getUsers, name="users"), 16 | 17 | path('/', views.getUserById, name='user'), 18 | 19 | path('update//', views.updateUser, name='user-update'), 20 | 21 | path('delete//', views.deleteUser, name='user-delete'), 22 | 23 | ] 24 | 25 | -------------------------------------------------------------------------------- /base/views/__pycache__/order_views.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/views/__pycache__/order_views.cpython-38.pyc -------------------------------------------------------------------------------- /base/views/__pycache__/order_views.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/views/__pycache__/order_views.cpython-39.pyc -------------------------------------------------------------------------------- /base/views/__pycache__/product_views.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/views/__pycache__/product_views.cpython-38.pyc -------------------------------------------------------------------------------- /base/views/__pycache__/product_views.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/views/__pycache__/product_views.cpython-39.pyc -------------------------------------------------------------------------------- /base/views/__pycache__/shop_views.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/views/__pycache__/shop_views.cpython-38.pyc -------------------------------------------------------------------------------- /base/views/__pycache__/shop_views.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/views/__pycache__/shop_views.cpython-39.pyc -------------------------------------------------------------------------------- /base/views/__pycache__/user_views.cpython-38.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/views/__pycache__/user_views.cpython-38.pyc -------------------------------------------------------------------------------- /base/views/__pycache__/user_views.cpython-39.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/base/views/__pycache__/user_views.cpython-39.pyc -------------------------------------------------------------------------------- /base/views/order_views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | from rest_framework.decorators import api_view, permission_classes 4 | from rest_framework.permissions import IsAuthenticated, IsAdminUser 5 | from rest_framework.response import Response 6 | 7 | from base.models import Product, Order, OrderItem, ShippingAddress 8 | from base.serializers import ProductSerializer, OrderSerializer 9 | 10 | from rest_framework import status 11 | from datetime import datetime 12 | 13 | 14 | # addOrderItems 15 | @api_view(['POST']) 16 | @permission_classes([IsAuthenticated]) 17 | def addOrderItems(request): 18 | user = request.user 19 | data = request.data 20 | 21 | orderItems = data['orderItems'] 22 | 23 | if orderItems and len(orderItems) == 0: 24 | return Response({'detail': 'No Order Items'}, status=status.HTTP_400_BAD_REQUEST) 25 | else: 26 | 27 | # (1) Create order 28 | 29 | order = Order.objects.create( 30 | user=user, 31 | paymentMethod=data['paymentMethod'], 32 | taxPrice=data['taxPrice'], 33 | shippingPrice=data['shippingPrice'], 34 | totalPrice=data['totalPrice'] 35 | ) 36 | 37 | # (2) Create shipping address 38 | 39 | shipping = ShippingAddress.objects.create( 40 | order=order, 41 | address=data['shippingAddress']['address'], 42 | city=data['shippingAddress']['city'], 43 | postalCode=data['shippingAddress']['postalCode'], 44 | country=data['shippingAddress']['country'], 45 | ) 46 | 47 | # (3) Create order items and set order to orderItem relationship 48 | for i in orderItems: 49 | product = Product.objects.get(_id=i['product']) 50 | 51 | item = OrderItem.objects.create( 52 | product=product, 53 | order=order, 54 | name=product.name, 55 | qty=i['qty'], 56 | price=i['price'], 57 | image=product.image.url, 58 | ) 59 | 60 | # (4) Update stock 61 | 62 | product.countInStock -= item.qty 63 | product.save() 64 | 65 | serializer = OrderSerializer(order, many=False) 66 | return Response(serializer.data) 67 | 68 | 69 | # getMyOrders 70 | @api_view(['GET']) 71 | @permission_classes([IsAuthenticated]) 72 | def getMyOrders(request): 73 | user = request.user 74 | orders = user.order_set.all() 75 | serializer = OrderSerializer(orders, many=True) 76 | return Response(serializer.data) 77 | 78 | 79 | # getOrders 80 | @api_view(['GET']) 81 | @permission_classes([IsAdminUser]) 82 | def getOrders(request): 83 | orders = Order.objects.all() 84 | serializer = OrderSerializer(orders, many=True) 85 | return Response(serializer.data) 86 | 87 | 88 | # getOrderById 89 | @api_view(['GET']) 90 | @permission_classes([IsAuthenticated]) 91 | def getOrderById(request, pk): 92 | 93 | user = request.user 94 | 95 | try: 96 | order = Order.objects.get(_id=pk) 97 | if user.is_staff or order.user == user: 98 | serializer = OrderSerializer(order, many=False) 99 | return Response(serializer.data) 100 | else: 101 | Response({'detail': 'Not authorized to view this order'}, 102 | status=status.HTTP_400_BAD_REQUEST) 103 | except: 104 | return Response({'detail': 'Order does not exist'}, status=status.HTTP_400_BAD_REQUEST) 105 | 106 | 107 | # updateOrderToPaid 108 | @api_view(['PUT']) 109 | @permission_classes([IsAuthenticated]) 110 | def updateOrderToPaid(request, pk): 111 | order = Order.objects.get(_id=pk) 112 | 113 | order.isPaid = True 114 | order.paidAt = datetime.now() 115 | order.save() 116 | 117 | return Response('Order was paid') 118 | 119 | 120 | # updateOrderToDelivered 121 | @api_view(['PUT']) 122 | @permission_classes([IsAdminUser]) 123 | def updateOrderToDelivered(request, pk): 124 | order = Order.objects.get(_id=pk) 125 | 126 | order.isDelivered = True 127 | order.deliveredAt = datetime.now() 128 | order.save() 129 | 130 | return Response('Order was delivered') 131 | -------------------------------------------------------------------------------- /base/views/product_views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | from rest_framework.decorators import api_view, permission_classes 4 | from rest_framework.permissions import IsAuthenticated, IsAdminUser 5 | from rest_framework.response import Response 6 | from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger 7 | 8 | from base.models import Product, Review 9 | from base.serializers import ProductSerializer 10 | 11 | # Create your views here. 12 | from rest_framework import status 13 | 14 | # All Products 15 | @api_view(['GET']) 16 | def getProducts(request): 17 | query = request.query_params.get('keyword') 18 | if query == None: 19 | query = '' 20 | 21 | products = Product.objects.filter( 22 | 23 | name__icontains=query 24 | 25 | ).order_by('-createdAt') 26 | 27 | page = request.query_params.get('page') 28 | paginator = Paginator(products, 3) 29 | 30 | try: 31 | products = paginator.page(page) 32 | except PageNotAnInteger: 33 | products = paginator.page(1) 34 | except EmptyPage: 35 | products = paginator.page(paginator.num_pages) 36 | 37 | if page == None: 38 | page = 1 39 | 40 | page = int(page) 41 | print('Page:', page) 42 | serializer = ProductSerializer(products, many=True) 43 | return Response({'products': serializer.data, 'page': page, 'pages': paginator.num_pages}) 44 | 45 | 46 | # getTopProducts 47 | @api_view(['GET']) 48 | def getTopProducts(request): 49 | products = Product.objects.filter(rating__gte=4).order_by('-rating')[0:5] 50 | serializer = ProductSerializer(products, many=True) 51 | return Response(serializer.data) 52 | 53 | 54 | # One Product 55 | @api_view(['GET']) 56 | def getProduct(request, pk): 57 | product = Product.objects.get(_id=pk) 58 | serializer = ProductSerializer(product, many=False) 59 | return Response(serializer.data) 60 | 61 | 62 | # create Product 63 | @api_view(['POST']) 64 | @permission_classes([IsAdminUser]) 65 | def createProduct(request): 66 | user = request.user 67 | 68 | product = Product.objects.create( 69 | user=user, 70 | name='Sample Name', 71 | price=0, 72 | brand='Sample Brand', 73 | countInStock=0, 74 | category='Sample Category', 75 | description='' 76 | ) 77 | 78 | serializer = ProductSerializer(product, many=False) 79 | return Response(serializer.data) 80 | 81 | # update Product 82 | @api_view(['PUT']) 83 | @permission_classes([IsAdminUser]) 84 | def updateProduct(request, pk): 85 | data = request.data 86 | product = Product.objects.get(_id=pk) 87 | 88 | product.name = data['name'] 89 | product.price = data['price'] 90 | product.brand = data['brand'] 91 | product.countInStock = data['countInStock'] 92 | product.category = data['category'] 93 | product.description = data['description'] 94 | 95 | product.save() 96 | 97 | serializer = ProductSerializer(product, many=False) 98 | return Response(serializer.data) 99 | 100 | 101 | # delete Product 102 | @api_view(['DELETE']) 103 | @permission_classes([IsAdminUser]) 104 | def deleteProduct(request, pk): 105 | product = Product.objects.get(_id=pk) 106 | product.delete() 107 | return Response('Product Deleted') 108 | 109 | 110 | # upload Image 111 | @api_view(['POST']) 112 | def uploadImage(request): 113 | data = request.data 114 | 115 | product_id = data['product_id'] 116 | product = Product.objects.get(_id=product_id) 117 | 118 | product.image = request.FILES.get('image') 119 | product.save() 120 | 121 | return Response('Image was uploaded') 122 | 123 | 124 | # createProductReview 125 | @api_view(['POST']) 126 | @permission_classes([IsAuthenticated]) 127 | def createProductReview(request, pk): 128 | user = request.user 129 | product = Product.objects.get(_id=pk) 130 | data = request.data 131 | 132 | # 1 - Review already exists 133 | alreadyExists = product.review_set.filter(user=user).exists() 134 | if alreadyExists: 135 | content = {'detail': 'Product already reviewed'} 136 | return Response(content, status=status.HTTP_400_BAD_REQUEST) 137 | 138 | # 2 - No Rating or 0 139 | elif data['rating'] == 0: 140 | content = {'detail': 'Please select a rating'} 141 | return Response(content, status=status.HTTP_400_BAD_REQUEST) 142 | 143 | # 3 - Create review 144 | else: 145 | review = Review.objects.create( 146 | user=user, 147 | product=product, 148 | name=user.first_name, 149 | rating=data['rating'], 150 | comment=data['comment'], 151 | ) 152 | 153 | reviews = product.review_set.all() 154 | product.numReviews = len(reviews) 155 | 156 | total = 0 157 | for i in reviews: 158 | total += i.rating 159 | 160 | product.rating = total / len(reviews) 161 | product.save() 162 | 163 | return Response('Review Added') 164 | -------------------------------------------------------------------------------- /base/views/shop_views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | 3 | from rest_framework.decorators import api_view, permission_classes 4 | from rest_framework.permissions import IsAuthenticated, IsAdminUser 5 | from rest_framework.response import Response 6 | from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger 7 | 8 | from base.models import Shop, Review_Shop 9 | from base.serializers import ShopSerializer 10 | 11 | # Create your views here. 12 | from rest_framework import status 13 | 14 | 15 | # All Shops 16 | @api_view(['GET']) 17 | def getShops(request): 18 | query = request.query_params.get('keyword') 19 | if query == None: 20 | query = '' 21 | 22 | shops = Shop.objects.filter( 23 | 24 | name__icontains=query 25 | 26 | ).order_by('-createdAt') 27 | 28 | page = request.query_params.get('page') 29 | paginator = Paginator(shops, 10) 30 | 31 | try: 32 | shops = paginator.page(page) 33 | except PageNotAnInteger: 34 | shops = paginator.page(1) 35 | except EmptyPage: 36 | shops = paginator.page(paginator.num_pages) 37 | 38 | if page == None: 39 | page = 1 40 | 41 | page = int(page) 42 | print('Page:', page) 43 | serializer = ShopSerializer(shops, many=True) 44 | return Response({'shops': serializer.data, 'page': page, 'pages': paginator.num_pages}) 45 | 46 | 47 | # getTopShops 48 | @api_view(['GET']) 49 | def getTopShops(request): 50 | shops = Shop.objects.filter(rating__gte=4).order_by('-rating')[0:5] 51 | serializer = ShopSerializer(shops, many=True) 52 | return Response(serializer.data) 53 | 54 | 55 | # One Shop 56 | @api_view(['GET']) 57 | def getShop(request, pk): 58 | shop = Shop.objects.get(_id=pk) 59 | serializer = ShopSerializer(shop, many=False) 60 | return Response(serializer.data) 61 | 62 | 63 | # createShopReview 64 | @api_view(['POST']) 65 | @permission_classes([IsAuthenticated]) 66 | def createShopReview(request, pk): 67 | user = request.user 68 | shop = Shop.objects.get(_id=pk) 69 | data = request.data 70 | 71 | # 1 - Review already exists 72 | alreadyExists = shop.review_set.filter(user=user).exists() 73 | if alreadyExists: 74 | content = {'detail': 'Shop already reviewed'} 75 | return Response(content, status=status.HTTP_400_BAD_REQUEST) 76 | 77 | # 2 - No Rating or 0 78 | elif data['rating'] == 0: 79 | content = {'detail': 'Please select a rating'} 80 | return Response(content, status=status.HTTP_400_BAD_REQUEST) 81 | 82 | # 3 - Create review 83 | else: 84 | review = Review_Shop.objects.create( 85 | user=user, 86 | shop=shop, 87 | name=user.first_name, 88 | rating=data['rating'], 89 | comment=data['comment'], 90 | ) 91 | 92 | reviews = shop.review.all() 93 | shop.numReviews = len(reviews) 94 | 95 | total = 0 96 | for i in reviews: 97 | total += i.rating 98 | 99 | shop.rating = total / len(reviews) 100 | shop.save() 101 | 102 | return Response('Review Added') -------------------------------------------------------------------------------- /base/views/user_views.py: -------------------------------------------------------------------------------- 1 | from django.shortcuts import render 2 | from rest_framework.decorators import api_view, permission_classes 3 | from rest_framework.permissions import IsAuthenticated, IsAdminUser 4 | from rest_framework.response import Response 5 | 6 | from django.contrib.auth.models import User 7 | from base.serializers import ProductSerializer, UserSerializer, ShopSerializer, UserSerializerWithToken 8 | 9 | # Create your views here. 10 | from rest_framework_simplejwt.serializers import TokenObtainPairSerializer 11 | from rest_framework_simplejwt.views import TokenObtainPairView 12 | 13 | from django.contrib.auth.hashers import make_password 14 | from rest_framework import status 15 | 16 | 17 | class MyTokenObtainPairSerializer(TokenObtainPairSerializer): 18 | def validate(self, attrs): 19 | data = super().validate(attrs) 20 | 21 | serializer = UserSerializerWithToken(self.user).data 22 | for k, v in serializer.items(): 23 | data[k] = v 24 | 25 | return data 26 | 27 | 28 | class MyTokenObtainPairView(TokenObtainPairView): 29 | serializer_class = MyTokenObtainPairSerializer 30 | 31 | # register User 32 | @api_view(['POST']) 33 | def registerUser(request): 34 | data = request.data 35 | try: 36 | user = User.objects.create( 37 | first_name=data['name'], 38 | username=data['email'], 39 | email=data['email'], 40 | password=make_password(data['password']) 41 | ) 42 | 43 | serializer = UserSerializerWithToken(user, many=False) 44 | return Response(serializer.data) 45 | except: 46 | message = {'detail':'User with this email already exists'} 47 | return Response(message, status=status.HTTP_400_BAD_REQUEST) 48 | 49 | 50 | # update profile 51 | @api_view(['PUT']) 52 | @permission_classes([IsAuthenticated]) 53 | def updateUserProfile(request): 54 | user = request.user 55 | serializer = UserSerializerWithToken(user, many=False) 56 | 57 | data = request.data 58 | user.first_name = data['name'] 59 | user.username = data['email'] 60 | user.email = data['email'] 61 | 62 | if data['password'] != '': 63 | user.password = make_password(data['password']) 64 | 65 | user.save() 66 | 67 | return Response(serializer.data) 68 | 69 | 70 | @api_view(['GET']) 71 | def getRoutes(request): 72 | routes = [ 73 | '/api/shops/', 74 | '/api/shops/create', 75 | '/api/products/', 76 | '/api/products/create', 77 | 78 | '/api/shops/upload/', 79 | '/api/products/upload/', 80 | 81 | 82 | '/api/shops//reviews/', 83 | '/api/products//reviews/', 84 | 85 | 86 | '/api/shops/top/', 87 | '/api/shops//', 88 | '/api/products/top/', 89 | '/api/products//', 90 | 91 | 92 | '/api/shops/delete//', 93 | '/api/shops/update//', 94 | '/api/products/delete//', 95 | '/api/products/update//', 96 | ] 97 | return Response(routes) 98 | 99 | 100 | # User Profile 101 | @api_view(['GET']) 102 | @permission_classes([IsAuthenticated]) 103 | def getUserProfile(request): 104 | user = request.user 105 | serializer = UserSerializer(user, many=False) 106 | return Response(serializer.data) 107 | 108 | 109 | # All Users 110 | @api_view(['GET']) 111 | @permission_classes([IsAdminUser]) 112 | def getUsers(request): 113 | users = User.objects.all() 114 | serializer = UserSerializer(users, many=True) 115 | return Response(serializer.data) 116 | 117 | 118 | # getUserById 119 | @api_view(['GET']) 120 | @permission_classes([IsAdminUser]) 121 | def getUserById(request, pk): 122 | user = User.objects.get(id=pk) 123 | serializer = UserSerializer(user, many=False) 124 | return Response(serializer.data) 125 | 126 | 127 | # updateUser 128 | @api_view(['PUT']) 129 | @permission_classes([IsAuthenticated]) 130 | def updateUser(request, pk): 131 | user = User.objects.get(id=pk) 132 | 133 | data = request.data 134 | 135 | user.first_name = data['name'] 136 | user.username = data['email'] 137 | user.email = data['email'] 138 | user.is_staff = data['isAdmin'] 139 | 140 | user.save() 141 | 142 | serializer = UserSerializer(user, many=False) 143 | 144 | return Response(serializer.data) 145 | 146 | 147 | # deleteUser 148 | @api_view(['DELETE']) 149 | @permission_classes([IsAdminUser]) 150 | def deleteUser(request, pk): 151 | userForDeletion = User.objects.get(id=pk) 152 | userForDeletion.delete() 153 | return Response('User has been deleted') -------------------------------------------------------------------------------- /db.sqlite3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/db.sqlite3 -------------------------------------------------------------------------------- /manage.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """Django's command-line utility for administrative tasks.""" 3 | import os 4 | import sys 5 | 6 | 7 | def main(): 8 | """Run administrative tasks.""" 9 | os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'backend.settings') 10 | try: 11 | from django.core.management import execute_from_command_line 12 | except ImportError as exc: 13 | raise ImportError( 14 | "Couldn't import Django. Are you sure it's installed and " 15 | "available on your PYTHONPATH environment variable? Did you " 16 | "forget to activate a virtual environment?" 17 | ) from exc 18 | execute_from_command_line(sys.argv) 19 | 20 | 21 | if __name__ == '__main__': 22 | main() 23 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | appdirs==1.4.4 2 | asgiref==3.2.10 3 | astroid==2.4.2 4 | autopep8==1.5.4 5 | boto3==1.14.31 6 | botocore==1.17.31 7 | cachelib==0.1 8 | certifi==2020.4.5.1 9 | chardet==3.0.4 10 | click==7.1.2 11 | colorama==0.4.4 12 | cs50==5.0.4 13 | distlib==0.3.1 14 | Django==3.1.4 15 | django-ckeditor==5.9.0 16 | django-cors-headers==3.5.0 17 | django-crispy-forms==1.9.2 18 | django-filter==2.3.0 19 | django-js-asset==1.2.2 20 | django-storages==1.9.1 21 | djangorestframework==3.11.1 22 | djangorestframework-simplejwt==4.4.0 23 | docutils==0.15.2 24 | filelock==3.0.12 25 | Flask==1.1.2 26 | Flask-Session==0.3.2 27 | gunicorn==20.0.4 28 | idna==2.9 29 | install==1.3.3 30 | isort==5.6.4 31 | itsdangerous==1.1.0 32 | Jinja2==2.11.2 33 | jmespath==0.10.0 34 | lazy-object-proxy==1.4.3 35 | MarkupSafe==1.1.1 36 | mccabe==0.6.1 37 | Pillow==8.0.1 38 | psycopg2==2.8.5 39 | pycodestyle==2.6.0 40 | PyJWT==1.7.1 41 | pylint==2.6.0 42 | python-dateutil==2.8.1 43 | python-dotenv==0.13.0 44 | pytz==2020.1 45 | requests==2.23.0 46 | s3transfer==0.3.3 47 | six==1.15.0 48 | SQLAlchemy==1.3.17 49 | sqlparse==0.3.1 50 | termcolor==1.1.0 51 | toml==0.10.2 52 | urllib3==1.25.9 53 | virtualenv==20.2.1 54 | Werkzeug==0.15.4 55 | whitenoise==5.1.0 56 | wrapt==1.12.1 -------------------------------------------------------------------------------- /static/css/index.css: -------------------------------------------------------------------------------- 1 | main{ 2 | min-height: 85vh; 3 | 4 | } 5 | 6 | .rating span{ 7 | margin:0.1rem; 8 | } 9 | 10 | h1{ 11 | font-size: 1.8rem; 12 | padding: 1rem 0; 13 | } 14 | 15 | h2{ 16 | font-size: 1.4rem; 17 | padding: 0.5rem 0; 18 | } 19 | 20 | 21 | h3{ 22 | padding:1rem 0; 23 | } 24 | 25 | 26 | .list{ 27 | margin: 0; 28 | padding: 0; 29 | list-style: none; 30 | text-align: center; 31 | 32 | padding: 0.6rem; 33 | border: solid 1px #f0f0f0; 34 | } 35 | 36 | 37 | .centered { 38 | display: flex; 39 | flex-direction: column; 40 | justify-content: center; 41 | align-items: center; 42 | text-align: center; 43 | min-height: 80vh; 44 | } 45 | 46 | .search{ 47 | padding: 50px; 48 | position: relative; 49 | left: auto; 50 | 51 | } 52 | 53 | /* carousel */ 54 | .carousel-item-next, 55 | .carousel-item-prev, 56 | .carousel-item.active { 57 | display: flex; 58 | } 59 | .carousel-caption { 60 | position: absolute; 61 | top: 0; 62 | } 63 | 64 | .carousel-caption h4 { 65 | color: #fff; 66 | } 67 | 68 | .carousel img { 69 | display:block; 70 | height: 300px; 71 | padding: 30px; 72 | margin: 40px; 73 | border-radius: 50%; 74 | margin-left: auto; 75 | margin-right: auto; 76 | } 77 | .carousel a { 78 | margin: 0 auto; 79 | } 80 | @media (max-width: 900px) { 81 | .carousel-caption h2 { 82 | font-size: 2.5vw; 83 | } 84 | } -------------------------------------------------------------------------------- /static/images/africa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/africa.png -------------------------------------------------------------------------------- /static/images/arachide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/arachide.png -------------------------------------------------------------------------------- /static/images/bobolos.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/bobolos.png -------------------------------------------------------------------------------- /static/images/diversity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/diversity.png -------------------------------------------------------------------------------- /static/images/divine.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/divine.png -------------------------------------------------------------------------------- /static/images/looking_shop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/looking_shop.png -------------------------------------------------------------------------------- /static/images/manioc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/manioc.png -------------------------------------------------------------------------------- /static/images/max.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/max.png -------------------------------------------------------------------------------- /static/images/nkui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/nkui.png -------------------------------------------------------------------------------- /static/images/ohg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/ohg.png -------------------------------------------------------------------------------- /static/images/okok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/okok.png -------------------------------------------------------------------------------- /static/images/palmoil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/palmoil.png -------------------------------------------------------------------------------- /static/images/quatrecote.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/quatrecote.png -------------------------------------------------------------------------------- /static/images/rondelle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/rondelle.png -------------------------------------------------------------------------------- /static/images/s1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s1.jpg -------------------------------------------------------------------------------- /static/images/s1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s1.png -------------------------------------------------------------------------------- /static/images/s10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s10.png -------------------------------------------------------------------------------- /static/images/s11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s11.png -------------------------------------------------------------------------------- /static/images/s12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s12.png -------------------------------------------------------------------------------- /static/images/s13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s13.png -------------------------------------------------------------------------------- /static/images/s14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s14.png -------------------------------------------------------------------------------- /static/images/s15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s15.png -------------------------------------------------------------------------------- /static/images/s16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s16.png -------------------------------------------------------------------------------- /static/images/s17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s17.png -------------------------------------------------------------------------------- /static/images/s18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s18.png -------------------------------------------------------------------------------- /static/images/s19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s19.png -------------------------------------------------------------------------------- /static/images/s2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s2.jpg -------------------------------------------------------------------------------- /static/images/s2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s2.png -------------------------------------------------------------------------------- /static/images/s20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s20.png -------------------------------------------------------------------------------- /static/images/s21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s21.png -------------------------------------------------------------------------------- /static/images/s3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s3.jpg -------------------------------------------------------------------------------- /static/images/s3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s3.png -------------------------------------------------------------------------------- /static/images/s4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s4.png -------------------------------------------------------------------------------- /static/images/s5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s5.jpg -------------------------------------------------------------------------------- /static/images/s6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s6.png -------------------------------------------------------------------------------- /static/images/s7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s7.png -------------------------------------------------------------------------------- /static/images/s8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s8.png -------------------------------------------------------------------------------- /static/images/s9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/s9.png -------------------------------------------------------------------------------- /static/images/shop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/shop.png -------------------------------------------------------------------------------- /static/images/shop_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/shop_open.png -------------------------------------------------------------------------------- /static/images/yam.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fhrryDeveloper/React-Django-Shope-backend/d89892454cda060a743612e8d206d11aea26fa05/static/images/yam.png --------------------------------------------------------------------------------