From c66404b99ab93a77aaebe9a971994a923462fd97 Mon Sep 17 00:00:00 2001 From: vdotup Date: Sun, 31 Jul 2022 23:21:38 +0300 Subject: [PATCH] done --- .gitignore | 1 + eCommerce/db.sqlite3 | Bin 0 -> 143360 bytes eCommerce/eCommerce/__init__.py | 0 .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 172 bytes .../__pycache__/settings.cpython-310.pyc | Bin 0 -> 2335 bytes .../__pycache__/urls.cpython-310.pyc | Bin 0 -> 1014 bytes .../__pycache__/wsgi.cpython-310.pyc | Bin 0 -> 579 bytes eCommerce/eCommerce/asgi.py | 16 ++ eCommerce/eCommerce/settings.py | 125 ++++++++++ eCommerce/eCommerce/urls.py | 22 ++ eCommerce/eCommerce/wsgi.py | 16 ++ eCommerce/eCommerce_app/__init__.py | 0 .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 176 bytes .../__pycache__/admin.cpython-310.pyc | Bin 0 -> 217 bytes .../__pycache__/apps.cpython-310.pyc | Bin 0 -> 468 bytes .../__pycache__/models.cpython-310.pyc | Bin 0 -> 953 bytes .../__pycache__/serializers.cpython-310.pyc | Bin 0 -> 913 bytes .../__pycache__/urls.cpython-310.pyc | Bin 0 -> 809 bytes .../__pycache__/views.cpython-310.pyc | Bin 0 -> 4073 bytes eCommerce/eCommerce_app/admin.py | 3 + eCommerce/eCommerce_app/apps.py | 6 + .../eCommerce_app/migrations/0001_initial.py | 38 +++ .../eCommerce_app/migrations/__init__.py | 0 .../__pycache__/0001_initial.cpython-310.pyc | Bin 0 -> 1158 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 187 bytes eCommerce/eCommerce_app/models.py | 21 ++ eCommerce/eCommerce_app/serializers.py | 15 ++ eCommerce/eCommerce_app/tests.py | 3 + eCommerce/eCommerce_app/urls.py | 19 ++ eCommerce/eCommerce_app/views.py | 221 ++++++++++++++++++ eCommerce/manage.py | 22 ++ 31 files changed, 528 insertions(+) create mode 100644 .gitignore create mode 100644 eCommerce/db.sqlite3 create mode 100644 eCommerce/eCommerce/__init__.py create mode 100644 eCommerce/eCommerce/__pycache__/__init__.cpython-310.pyc create mode 100644 eCommerce/eCommerce/__pycache__/settings.cpython-310.pyc create mode 100644 eCommerce/eCommerce/__pycache__/urls.cpython-310.pyc create mode 100644 eCommerce/eCommerce/__pycache__/wsgi.cpython-310.pyc create mode 100644 eCommerce/eCommerce/asgi.py create mode 100644 eCommerce/eCommerce/settings.py create mode 100644 eCommerce/eCommerce/urls.py create mode 100644 eCommerce/eCommerce/wsgi.py create mode 100644 eCommerce/eCommerce_app/__init__.py create mode 100644 eCommerce/eCommerce_app/__pycache__/__init__.cpython-310.pyc create mode 100644 eCommerce/eCommerce_app/__pycache__/admin.cpython-310.pyc create mode 100644 eCommerce/eCommerce_app/__pycache__/apps.cpython-310.pyc create mode 100644 eCommerce/eCommerce_app/__pycache__/models.cpython-310.pyc create mode 100644 eCommerce/eCommerce_app/__pycache__/serializers.cpython-310.pyc create mode 100644 eCommerce/eCommerce_app/__pycache__/urls.cpython-310.pyc create mode 100644 eCommerce/eCommerce_app/__pycache__/views.cpython-310.pyc create mode 100644 eCommerce/eCommerce_app/admin.py create mode 100644 eCommerce/eCommerce_app/apps.py create mode 100644 eCommerce/eCommerce_app/migrations/0001_initial.py create mode 100644 eCommerce/eCommerce_app/migrations/__init__.py create mode 100644 eCommerce/eCommerce_app/migrations/__pycache__/0001_initial.cpython-310.pyc create mode 100644 eCommerce/eCommerce_app/migrations/__pycache__/__init__.cpython-310.pyc create mode 100644 eCommerce/eCommerce_app/models.py create mode 100644 eCommerce/eCommerce_app/serializers.py create mode 100644 eCommerce/eCommerce_app/tests.py create mode 100644 eCommerce/eCommerce_app/urls.py create mode 100644 eCommerce/eCommerce_app/views.py create mode 100644 eCommerce/manage.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..eba74f4c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +venv/ \ No newline at end of file diff --git a/eCommerce/db.sqlite3 b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*+vcF``a-spWinK-Xg=Fk4-e5qZ+1S?kJ-1ZJ(vGa{dGQ|m}< zfN3;hnJE)$#60eDI|h%(xLEpo@M@)5zul2aBP1Sk!bz=WQ@T*Ioi5X`9N?C^NVBCb zv11t)sO8K&6KFPL@;WxA_y5TwGF+pWAOHd&00JNY0w4eaAOHd&00JQJ$PpMK-*SwQ z_c+LZlm8(9PX2{_p8Os86nUL|f_#Mh5&1pxLGtV5{p1(Od)S{x4i5?p0w4eaAOHd& z00JNY0w4eaAOHgQhk)BD2m@n09OdB%4~Kb3co^bgkcR;t`gu6S!$BVUc Dxy7qA literal 0 HcmV?d00001 diff --git a/eCommerce/eCommerce/__init__.py b/eCommerce/eCommerce/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/eCommerce/eCommerce/__pycache__/__init__.cpython-310.pyc b/eCommerce/eCommerce/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9db6ebc6f69e776507af4613cd2aa7c9cb31507a GIT binary patch literal 172 zcmd1j<>g`kf~ft^l0fuh5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;!H&i&acPWl2VU zUVK4OepYI7NpXxzR$^XyzHX3fa7c`cm!qG%e>{jC@8jrX5|iqjpPQRnl$?shijU9C e%PfhH*DI*J#bJ}1pHiBWY6r5YmHJGUli!2%9aIW?6cX_^Lg8d{`nC6XwJRNN8<2#ULsSLQ|L zuHu@n{f#`dc_`4Y=oj<{_*$Sqf1nRV(R3)uvLFYjONqa)(39Zv?_ySI||o z0ybCC>S(++8m|++CtAzshIJL)v{oS6D%{u5E$ce^z`B8M8(is*Bl8?rQ2S2M3nhvf zBSDW!-7u1HCG>q9xmX%RVIR9pE);fffFp-tBy~=tduZgf;UJ#`5@k-rCYJZ4Aq5<1 z0{cjQAU_80Z9w(I2umb@0KUUW7)bDE2LwVA4}S_7;KBi81NyXFMxjgPag5Up+|V!M zpbUUz77mC@%cm)q$MEa`OWmR8Ngkn03cF{YEN9dC%~|A`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FLx7W8?DhlJpSH)@cDHvwgaZ(gjvR411s<)Cs zKusYW1+mM1ueV?6S_($@F;5tM)iZG~@JD%~)WHmdks9j%SO~qO(hv!)QCm9i0n4&~ zARAL3CMq@{{oo%)Cp^v9B;yM(!S*xKQn<{mKPT203{>EHOfBsPcwSjKxU=i-IznUk zmSk1CZ%uhH+gUCa5g54b)H4Z-+Y18!Hw-TdoU)k^mhr$XJ>z)UuBtaJn~yd-Fc@T= zY87ps-cPCZ(J(v0>~{NcJeU^OdMS8Zji;K9?X(`8A6;Bd#~+4g?>@yQj!%bg52yD8YmsRY7T0Cx aB?BQjeeD3g>cZxs?&Bv;x6ySvfBpi&K|GcK literal 0 HcmV?d00001 diff --git a/eCommerce/eCommerce/__pycache__/wsgi.cpython-310.pyc b/eCommerce/eCommerce/__pycache__/wsgi.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..85979959d269d3e912a4c59307421b0994e8f2eb GIT binary patch literal 579 zcmYjP!EO^V5cO`-rYsa8RB`q-65Z{grwSoj5~4s!B{m3Y70GeelZ_*c*}nLzWfpp@~cUyBuPoo}JfTAxX_E5ej?cW-}2pVGmQ=BQ_~pfju~yvDMG zItNPr2@(g<+Ma`rQlG(5)@tXTCPi)mmuhL%BxDr zoLh-{I`#A3c$^Yzpi+Cta$TUP{cvgMOe%Oz4L~%vwlXJ4A}}|xSa4n7e@;1;3FzcF zK1$|zZ7~s0DO{DHZE|f2nM8m5g^*D(E2F4(O$uM_@SSUCwKIkn4O=V9Z&9gZAA@uT&>*Ri_QJN T^k0OS2Bb~)9y|&khf(+s$fLDB literal 0 HcmV?d00001 diff --git a/eCommerce/eCommerce/asgi.py b/eCommerce/eCommerce/asgi.py new file mode 100644 index 00000000..534f83bb --- /dev/null +++ b/eCommerce/eCommerce/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for eCommerce project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'eCommerce.settings') + +application = get_asgi_application() diff --git a/eCommerce/eCommerce/settings.py b/eCommerce/eCommerce/settings.py new file mode 100644 index 00000000..30316eeb --- /dev/null +++ b/eCommerce/eCommerce/settings.py @@ -0,0 +1,125 @@ +""" +Django settings for eCommerce project. + +Generated by 'django-admin startproject' using Django 4.0.6. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/4.0/ref/settings/ +""" + +from pathlib import Path + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/4.0/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-@mgm%rm+5a$!kcf=r$*u==ljbc=tqjt*8ca-$ww%psns90-$*q' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'rest_framework', + 'eCommerce_app' +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'eCommerce.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'eCommerce.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/4.0/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/4.0/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/4.0/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/4.0/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/eCommerce/eCommerce/urls.py b/eCommerce/eCommerce/urls.py new file mode 100644 index 00000000..964b5d0b --- /dev/null +++ b/eCommerce/eCommerce/urls.py @@ -0,0 +1,22 @@ +"""eCommerce URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/4.0/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path, include + +urlpatterns = [ + path('admin/', admin.site.urls), + path('products/', include("eCommerce_app.urls")) +] diff --git a/eCommerce/eCommerce/wsgi.py b/eCommerce/eCommerce/wsgi.py new file mode 100644 index 00000000..18d60638 --- /dev/null +++ b/eCommerce/eCommerce/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for eCommerce project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'eCommerce.settings') + +application = get_wsgi_application() diff --git a/eCommerce/eCommerce_app/__init__.py b/eCommerce/eCommerce_app/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/eCommerce/eCommerce_app/__pycache__/__init__.cpython-310.pyc b/eCommerce/eCommerce_app/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6432dd13496c34b13de692fdb33170f56f40cdd6 GIT binary patch literal 176 zcmd1j<>g`kf+hQ(C4uP2AOaaM0yz#qT+9L_QW%06G#UL?G8BP?5yY=x7ps_p%94!y zy!e8m{H)aElHwSbti-(ZeBB_|;E)&>FGoLj|9B8P-pA3&Bqr54KQ}kEC^;3uicc&k jh>4HS%*!l^kJl@xyv1RYo1apelWGUDte6Q%urL4s-ZU&c literal 0 HcmV?d00001 diff --git a/eCommerce/eCommerce_app/__pycache__/admin.cpython-310.pyc b/eCommerce/eCommerce_app/__pycache__/admin.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e49d827e78daffb182084446a75c68df4c7b1c75 GIT binary patch literal 217 zcmd1j<>g`kf+hQ(B{>1<#~=%$ W7Kcr4eoARhsvRTHl46jB0t^5u?KhPG literal 0 HcmV?d00001 diff --git a/eCommerce/eCommerce_app/__pycache__/apps.cpython-310.pyc b/eCommerce/eCommerce_app/__pycache__/apps.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c6e793df07c796eda04c1971998763da1ffc4fb5 GIT binary patch literal 468 zcmYjN%SyvQ6rIVW68qScZUwhln3XFLY5K4rl7e*=0z;aa)|MnQW|BqS>YwPwukb%+ zD+vCAEAOPG?S*^i+}GjE6`f8Kfqi`a%-`YtHp#Ksko3XTIRu6nPEm$KjL`%!i;*|P z2*F6qwoAOEIR2E{*lTt;aTFu47c=i~L z?)+dfr3TY`e{dP?wH%O96@e>HZVCd_=CbMpf`e@A;JOyLM7MVTG_!?eG??jwnk{NU SO*_}yZ{3)iDnr;tJ@OCK8F(iE literal 0 HcmV?d00001 diff --git a/eCommerce/eCommerce_app/__pycache__/models.cpython-310.pyc b/eCommerce/eCommerce_app/__pycache__/models.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..136b6a2e87ff2f700248a91124f869e8bc66771a GIT binary patch literal 953 zcmZuv&2H2%5VrH5Y_@C*;vM!tPdy=ox<73Nl%=%g60Kx;7i1XR<0)iFwNq3A5Iuu=lbZDQ zurWBq*&Lt&l2Abs%N!-Bux@DLf_>|KBZ-d~Ack9Ok+89pqusIOrMM^ftUIcsf?u;7 z%B5P(hCLlHR`LQE(-C8MiL2cBF=HREc;2l@a|sXs&9C><=kt1_R#nMrS*;;e&3wA% z<+6Hqespm;pS~W=PTn!&v(wS|U=EY2C_tw0;4xm;^Nzs%dLxZgKF-D{8jzR<_zh^A z|A*kex}M?YZGr)*U3-GwSccqnAS_`c;YjdpghclcW5hn<4&o!k0pc#=9^zx+Ao;HL z&m@wXD%3c{H=@X(K)P5=dT3_DCo(WWXpFgV$98mFNywJv8|dDn{mJNJGMXMG?!u@k zd$?6QMj+WYf9;q!_;7yO5g%p+Ujn<5xsHzWig!9CZY{GEbo{DRu!K&|BtWT4lysxx zaaHBO%TClVYZy;e_6Z*J>bzZ3aSx5D+88kdGN2vNhU}QOtFxi6BWwVbH7ZLRi4BN- nBwBU%#iDzu`_^=RD^B~<|7z*rMc0}ysVQg(i&57-_o@FI#4G9I literal 0 HcmV?d00001 diff --git a/eCommerce/eCommerce_app/__pycache__/serializers.cpython-310.pyc b/eCommerce/eCommerce_app/__pycache__/serializers.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..167f6680a812205b5d85a55f89cdf2567500f355 GIT binary patch literal 913 zcma)4y>1gh5Z<5rOJc`~2`PAkD@a9!5K4lhNGLG~BZ`xy)#2TM&7JQucM*!)hEfo4DF8~e`E5gdBLUiY96gYPzyi`0jqp%KymJVQQ`3xS~!X$WIO50FOi z(9k0!5B3aAkbHP-=m}B)Pl+yu%MhNOvFZLT`eakyIAu~@-f|7SuUF!mY69`T$TA^U zB2LP(9;~EDDluz9-HA(Cz-Cp^=sd|p-NQW0nt+-vsp`q51R6FsC*Tmlm}X-#BSQ+rrMyZlN)w3!m$Z z`6)GH8j?c|=YR%In6RXL#1BIHVh*UZD8Q=Z+QHA#Yzxw~p24&Oi6h9cWJO AY5)KL literal 0 HcmV?d00001 diff --git a/eCommerce/eCommerce_app/__pycache__/views.cpython-310.pyc b/eCommerce/eCommerce_app/__pycache__/views.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..07f6a9bf3531417f06cb7940bfe31814da94215f GIT binary patch literal 4073 zcmaJ^TW=f372cV>l3ZRy$&zKq3DYKx*`}(SIBA-uZETadx|AR>2ucVbXwJ%BW_juC z%Blo92;laudMVJS#DMkar#`g*A^%}tQxx#C-_)SaIcJvSl2$@uXJ^jb=R4nbW{3HF zR)b&VKmWb;&oxc^1`Fw*0fl$r3EyIxCN#kUtw(cXTPEd=!0OvA zoAPGh^fRpt$@$N%1)5)7g~jWu~lT6r;E&OcAtr?XYO&46YgJ(`>a(0 zdp>0^h$7jSz+Ot(mqeNDWw0-&>?`6N*_Ri_UlnU)Us)LcyjUmuxrOmBh>K)jT^Rp4 zaf$3}3*$U5ULgBcvNI51SxPKBp7c9`f8@!yNOdWLv9-C=jBTlA z=;BzDABPO0djp;)??Do2W39&oJ7)LTm_6htnk>RwKhc;r$VGkh zPxyU+Z)(wnK^7kAJ>#KyqK(;@|CO(6_w>jTW@L}``|L{~C)GPA+Lzh`Bg%|*VGHM& z_p%}baOZli$Rga;TtlMYNOYuFzwJejQ9e$czz?I!aIbQ7p_1${e6Lg5H{hL}($yLp zy_~QCKNIkq(3J~^M$ad7%^+R5F9?X!asotUFpMgDaGYX;AOWCWhV>H&^Nc$VkU2$N?0N^79~%xzf-CY~%3q6l^mAJJHkc1smFpdCvi&nh!Xs zZ6<-wYRK1NPC`$)DzD9 z8e6=L$!{=OJZCl7?GooL*3Xf!8p>9{0|Pzw=7mf(GQj-uOQ zFd;F%;j`imS>rTtbb}T>uFgB@0@A)htOz_ z*|@L?v*l}0sAf`ZJ5?^SsFdI(p3nu<+kdc!q0yYMI=Obco5wER4w} zTz!p1rp?1QL8jq@24b>>A1@%gHpE-F6-{N@{M@9N3~!3b85k!E<79xLe5}(w%Yxq7 zC^xo)61V-?TjWJ>0z5LB5uGh$?UBKe`h#S;}p zPWcL)M78w2Y&;VoylBY}Fd=3VVAGqpg3eZVDS{3~TeI&MLeoZdJ$Cj7eiXrn6Ny7>T|&0K2X{s9U?@M^5MFmEJJC>vQimR` z)rI=xn@FO+x7MDiRNrChc3GIORd*PxKLoc7Ra8Zk;3>j$37)m2 KypoicSJ-#dBzF`5 literal 0 HcmV?d00001 diff --git a/eCommerce/eCommerce_app/admin.py b/eCommerce/eCommerce_app/admin.py new file mode 100644 index 00000000..8c38f3f3 --- /dev/null +++ b/eCommerce/eCommerce_app/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/eCommerce/eCommerce_app/apps.py b/eCommerce/eCommerce_app/apps.py new file mode 100644 index 00000000..85a23778 --- /dev/null +++ b/eCommerce/eCommerce_app/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class EcommerceAppConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'eCommerce_app' diff --git a/eCommerce/eCommerce_app/migrations/0001_initial.py b/eCommerce/eCommerce_app/migrations/0001_initial.py new file mode 100644 index 00000000..4ea72ab0 --- /dev/null +++ b/eCommerce/eCommerce_app/migrations/0001_initial.py @@ -0,0 +1,38 @@ +# Generated by Django 4.0.6 on 2022-07-31 18:53 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Brand', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=512)), + ('description', models.TextField()), + ('established_at', models.DateField()), + ('city', models.CharField(max_length=512)), + ], + ), + migrations.CreateModel( + name='Product', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=512)), + ('description', models.TextField()), + ('image_url', models.URLField()), + ('price', models.FloatField()), + ('quantity', models.IntegerField()), + ('is_active', models.BooleanField()), + ('brand', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='eCommerce_app.brand')), + ], + ), + ] diff --git a/eCommerce/eCommerce_app/migrations/__init__.py b/eCommerce/eCommerce_app/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/eCommerce/eCommerce_app/migrations/__pycache__/0001_initial.cpython-310.pyc b/eCommerce/eCommerce_app/migrations/__pycache__/0001_initial.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5b45d578478a76989193d266891a99a81f039827 GIT binary patch literal 1158 zcmZuw&2Aev5GJWzX|-C*cI>$6Bd9=Cr|78&g2+-Fq)pr+b}tJ71hpKmx!u2TsUXTV zz4{%}W1psXo(dEwkOv4*v_R0|N{)3X2@bv)lJoNoS?%nE1joDI|5_A2A%8k$dw8fk z!qtpXNFr%Y3L4Xb#f&|e|zXJYW?ja+G)`pM8g&xAlhxw zA>QAE{p?QG%MP+bc~>4?vrCo+E^f-=yYe&S=AP|8zaizq`X^eH(lRAaEqgi}c{UPD zQ}INDFd*%q)~XPC#easC?Khy6$kiLL(JRo4ssUb#0<3S8$w3i@q*EkayyiKSskyQP z2~DC^?OI@m&=|4ERdWTB3uC=RnH6@)Yn^m2738w9y&rWYmxL1AHwQ4SiUM>3T-5crHDZ8%RdVb-7_iJ#XQLw<@HTVK zZOA!3jAagpBhJxz?$SZ6r%Gk8UK>fMp_EW23L1??5<8f-1U+|8N_U(kI#KBasXKL5 z*#7iN=ncGp*JcA}Na`8}KfQRiM&W5*iOqrNX=xyZ&CTefs&WwJ&ACd0O3UxD6J42! zGOa9=3mdeRIevT7$@z3Ldu+q1hRw78jp(m1y;l6Qn0-61SLO=osCAV=Vw(A^_4MV7 z$LAOG*>{t(CqHn9`LoH%H}g+)-Xcfr{PtVTkB^V<^9@tudZpdJ?cr*^MiCH?;q(|i zWJ4O_98&hL_t6V)EzTO!dzAg{eGERd_eWjZUspJmiZ$7r*`gLRJ|Qq-C*iai$4qt1V0;Z&jk literal 0 HcmV?d00001 diff --git a/eCommerce/eCommerce_app/migrations/__pycache__/__init__.cpython-310.pyc b/eCommerce/eCommerce_app/migrations/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..93ce80206f1b368e6a4ca0cbaa5a1f7525fbbd10 GIT binary patch literal 187 zcmd1j<>g`kf+hQ(C4uP2AOaaM0yz#qT+9L_QW%06G#UL?G8BP?5yY=J7ps_p%94!y zy!e8m{H)aElHwSbti-(ZeBB_|;E)&>FGoLj|9B8P-pA3&Bqr54KQ}kEC^;3uicc&k uh{?@NFG?)Q%+D*1iI30B%PfhH*DI*J#bJ}1pHiBWY6r5nm/", views.update_product, name="update_product"), + path("delete//", views.delete_product, name="delete_product"), + + path("brands/create/", views.create_brand, name="create_brand"), + path("brands/read/", views.read_brands, name="read_brands"), + path("brands/update//", views.update_brand, name="update_brand"), + path("brands/delete//", views.delete_brand, name="delete_brand"), + + path('brand_products//', + views.read_brand_products, name="read_brand_products") +] diff --git a/eCommerce/eCommerce_app/views.py b/eCommerce/eCommerce_app/views.py new file mode 100644 index 00000000..eafb6fed --- /dev/null +++ b/eCommerce/eCommerce_app/views.py @@ -0,0 +1,221 @@ +from unittest import skip +from rest_framework.decorators import api_view +from rest_framework.request import Request +from rest_framework.response import Response + +from rest_framework import status + +from .models import Product, Brand +from .serializers import ProductSerializer, BrandSerializer + +# Create your views here. + + +@api_view(["POST"]) +def create_product(request: Request): + product_serializer = ProductSerializer(data=request.data) + if product_serializer.is_valid(): + product_serializer.save() + else: + return Response( + { + "msg": "Product object invalid.", + "error": product_serializer.errors + }, + status=status.HTTP_403_FORBIDDEN + ) + + return Response( + { + "msg": "Product created." + }, + status=status.HTTP_201_CREATED + ) + + +@api_view(["GET"]) +def read_products(request: Request): + skip = int(request.query_params.get("skip", 0)) + get = int(request.query_params.get("get", 10)) + + all_products = Product.objects.all()[skip:get] + + return Response( + { + "msg": f'list of {len(all_products)} products, total products {Product.objects.count()}', + "products": ProductSerializer(instance=all_products, many=True).data + }, + status=status.HTTP_200_OK + ) + + +@api_view(["PUT"]) +def update_product(request: Request, product_id): + try: + product = Product.objects.get(id=product_id) + except Exception as e: + return Response( + { + "msg": f'product not found.', + }, + status=status.HTTP_404_NOT_FOUND + ) + product_serializer = ProductSerializer(instance=product, data=request.data) + if product_serializer.is_valid(): + product_serializer.save() + else: + return Response( + { + "msg": "Product object invalid.", + "error": product_serializer.errors + }, + status=status.HTTP_403_FORBIDDEN + ) + return Response( + { + "msg": f'product updated.', + }, + status=status.HTTP_200_OK + ) + + +@api_view(["DELETE"]) +def delete_product(request: Request, product_id): + try: + product = Product.objects.get(id=product_id) + product.delete() + except Exception as e: + return Response( + { + "msg": f'product not found.', + }, + status=status.HTTP_404_NOT_FOUND + ) + return Response( + { + "msg": f'{product.title} product deleted.', + }, + status=status.HTTP_200_OK + ) + + +################################### +# BRAND +################################### + +@api_view(["POST"]) +def create_brand(request: Request): + brand_serializer = BrandSerializer(data=request.data) + if brand_serializer.is_valid(): + brand_serializer.save() + else: + return Response( + { + "msg": "Brand object invalid.", + "error": brand_serializer.errors + }, + status=status.HTTP_403_FORBIDDEN + ) + + return Response( + { + "msg": "Brand created." + }, + status=status.HTTP_201_CREATED + ) + + +@api_view(["GET"]) +def read_brands(request: Request): + skip = int(request.query_params.get("skip", 0)) + get = int(request.query_params.get("get", 10)) + + if "search" in request.query_params: + search_phrase = request.query_params["search"] + all_products = Brand.objects.filter( + title__startswith=search_phrase)[skip:get] + else: + all_products = Brand.objects.all()[skip:get] + + return Response( + { + "msg": f'list of {len(all_products)} brands', + "brands": BrandSerializer(instance=all_products, many=True).data + }, + status=status.HTTP_200_OK + ) + + +@api_view(["PUT"]) +def update_brand(request: Request, brand_id): + try: + brand = Brand.objects.get(id=brand_id) + except Exception as e: + return Response( + { + "msg": f'brand not found.', + }, + status=status.HTTP_404_NOT_FOUND + ) + brand_serializer = BrandSerializer(instance=brand, data=request.data) + if brand_serializer.is_valid(): + brand_serializer.save() + else: + return Response( + { + "msg": "Brand object invalid.", + "error": brand_serializer.errors + }, + status=status.HTTP_403_FORBIDDEN + ) + return Response( + { + "msg": f'brand updated.', + }, + status=status.HTTP_200_OK + ) + + +@api_view(["DELETE"]) +def delete_brand(request: Request, brand_id): + try: + brand = Brand.objects.get(id=brand_id) + brand.delete() + except Exception as e: + return Response( + { + "msg": f'brand not found.', + }, + status=status.HTTP_404_NOT_FOUND + ) + return Response( + { + "msg": f'{brand.title} brand deleted.', + }, + status=status.HTTP_200_OK + ) + + +@api_view(["GET"]) +def read_brand_products(request: Request, brand_id): + skip = int(request.query_params.get("skip", 0)) + get = int(request.query_params.get("get", 10)) + + try: + brand = Brand.objects.get(id=brand_id) + except Exception as e: + return Response( + { + "msg": f'brand not found.', + }, + status=status.HTTP_404_NOT_FOUND + ) + + all_products = Product.objects.filter(brand=brand_id)[skip:get] + return Response( + { + "msg": f'list of {len(all_products)} products branded {brand.title}', + "products": ProductSerializer(instance=all_products, many=True).data + }, + status=status.HTTP_200_OK + ) diff --git a/eCommerce/manage.py b/eCommerce/manage.py new file mode 100644 index 00000000..aa3d79c9 --- /dev/null +++ b/eCommerce/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'eCommerce.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main()