From df5ea18f235ddb995df940eec929b034e84ebc10 Mon Sep 17 00:00:00 2001 From: louai98 Date: Thu, 28 Nov 2024 16:06:12 +0100 Subject: [PATCH] first commit --- docker-compose.yml | 28 ++++ salw_admin/Dockerfile | 20 +++ salw_admin/db.sqlite3 | Bin 0 -> 155648 bytes salw_admin/manage.py | 22 +++ salw_admin/pssm_api/__init__.py | 0 .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 118 bytes .../__pycache__/__init__.cpython-38.pyc | Bin 0 -> 154 bytes .../__pycache__/admin.cpython-310.pyc | Bin 0 -> 1232 bytes .../pssm_api/__pycache__/admin.cpython-38.pyc | Bin 0 -> 1324 bytes .../pssm_api/__pycache__/apps.cpython-310.pyc | Bin 0 -> 552 bytes .../pssm_api/__pycache__/apps.cpython-38.pyc | Bin 0 -> 586 bytes .../__pycache__/models.cpython-310.pyc | Bin 0 -> 2519 bytes .../__pycache__/models.cpython-38.pyc | Bin 0 -> 2657 bytes .../__pycache__/serializers.cpython-310.pyc | Bin 0 -> 608 bytes .../__pycache__/serializers.cpython-38.pyc | Bin 0 -> 640 bytes .../__pycache__/signals.cpython-310.pyc | Bin 0 -> 853 bytes .../__pycache__/signals.cpython-38.pyc | Bin 0 -> 969 bytes .../pssm_api/__pycache__/urls.cpython-310.pyc | Bin 0 -> 319 bytes .../pssm_api/__pycache__/urls.cpython-38.pyc | Bin 0 -> 355 bytes .../__pycache__/views.cpython-310.pyc | Bin 0 -> 573 bytes .../pssm_api/__pycache__/views.cpython-38.pyc | Bin 0 -> 607 bytes salw_admin/pssm_api/admin.py | 24 ++++ salw_admin/pssm_api/apps.py | 9 ++ .../pssm_api/migrations/0001_initial.py | 67 +++++++++ ..._rename_country_id_african_countries_id.py | 18 +++ salw_admin/pssm_api/migrations/__init__.py | 0 .../__pycache__/0001_initial.cpython-310.pyc | Bin 0 -> 1833 bytes .../__pycache__/0001_initial.cpython-38.pyc | Bin 0 -> 1867 bytes ...ry_id_african_countries_id.cpython-310.pyc | Bin 0 -> 547 bytes ...try_id_african_countries_id.cpython-38.pyc | Bin 0 -> 581 bytes .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 129 bytes .../__pycache__/__init__.cpython-38.pyc | Bin 0 -> 165 bytes salw_admin/pssm_api/models.py | 52 +++++++ salw_admin/pssm_api/serializers.py | 7 + salw_admin/pssm_api/signals.py | 26 ++++ salw_admin/pssm_api/tests.py | 3 + salw_admin/pssm_api/urls.py | 10 ++ salw_admin/pssm_api/views.py | 10 ++ salw_admin/requirements.txt | 4 + salw_admin/salw_admin/__init__.py | 0 .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 120 bytes .../__pycache__/__init__.cpython-38.pyc | Bin 0 -> 156 bytes .../__pycache__/settings.cpython-310.pyc | Bin 0 -> 2444 bytes .../__pycache__/settings.cpython-38.pyc | Bin 0 -> 2556 bytes .../__pycache__/urls.cpython-310.pyc | Bin 0 -> 972 bytes .../__pycache__/urls.cpython-38.pyc | Bin 0 -> 1008 bytes .../__pycache__/wsgi.cpython-310.pyc | Bin 0 -> 529 bytes .../__pycache__/wsgi.cpython-38.pyc | Bin 0 -> 565 bytes salw_admin/salw_admin/asgi.py | 16 +++ salw_admin/salw_admin/settings.py | 136 ++++++++++++++++++ salw_admin/salw_admin/urls.py | 23 +++ salw_admin/salw_admin/wsgi.py | 16 +++ salw_client | 1 + 53 files changed, 492 insertions(+) create mode 100644 docker-compose.yml create mode 100644 salw_admin/Dockerfile create mode 100644 salw_admin/db.sqlite3 create mode 100755 salw_admin/manage.py create mode 100644 salw_admin/pssm_api/__init__.py create mode 100644 salw_admin/pssm_api/__pycache__/__init__.cpython-310.pyc create mode 100644 salw_admin/pssm_api/__pycache__/__init__.cpython-38.pyc create mode 100644 salw_admin/pssm_api/__pycache__/admin.cpython-310.pyc create mode 100644 salw_admin/pssm_api/__pycache__/admin.cpython-38.pyc create mode 100644 salw_admin/pssm_api/__pycache__/apps.cpython-310.pyc create mode 100644 salw_admin/pssm_api/__pycache__/apps.cpython-38.pyc create mode 100644 salw_admin/pssm_api/__pycache__/models.cpython-310.pyc create mode 100644 salw_admin/pssm_api/__pycache__/models.cpython-38.pyc create mode 100644 salw_admin/pssm_api/__pycache__/serializers.cpython-310.pyc create mode 100644 salw_admin/pssm_api/__pycache__/serializers.cpython-38.pyc create mode 100644 salw_admin/pssm_api/__pycache__/signals.cpython-310.pyc create mode 100644 salw_admin/pssm_api/__pycache__/signals.cpython-38.pyc create mode 100644 salw_admin/pssm_api/__pycache__/urls.cpython-310.pyc create mode 100644 salw_admin/pssm_api/__pycache__/urls.cpython-38.pyc create mode 100644 salw_admin/pssm_api/__pycache__/views.cpython-310.pyc create mode 100644 salw_admin/pssm_api/__pycache__/views.cpython-38.pyc create mode 100644 salw_admin/pssm_api/admin.py create mode 100644 salw_admin/pssm_api/apps.py create mode 100644 salw_admin/pssm_api/migrations/0001_initial.py create mode 100644 salw_admin/pssm_api/migrations/0002_rename_country_id_african_countries_id.py create mode 100644 salw_admin/pssm_api/migrations/__init__.py create mode 100644 salw_admin/pssm_api/migrations/__pycache__/0001_initial.cpython-310.pyc create mode 100644 salw_admin/pssm_api/migrations/__pycache__/0001_initial.cpython-38.pyc create mode 100644 salw_admin/pssm_api/migrations/__pycache__/0002_rename_country_id_african_countries_id.cpython-310.pyc create mode 100644 salw_admin/pssm_api/migrations/__pycache__/0002_rename_country_id_african_countries_id.cpython-38.pyc create mode 100644 salw_admin/pssm_api/migrations/__pycache__/__init__.cpython-310.pyc create mode 100644 salw_admin/pssm_api/migrations/__pycache__/__init__.cpython-38.pyc create mode 100644 salw_admin/pssm_api/models.py create mode 100644 salw_admin/pssm_api/serializers.py create mode 100644 salw_admin/pssm_api/signals.py create mode 100644 salw_admin/pssm_api/tests.py create mode 100644 salw_admin/pssm_api/urls.py create mode 100644 salw_admin/pssm_api/views.py create mode 100644 salw_admin/requirements.txt create mode 100644 salw_admin/salw_admin/__init__.py create mode 100644 salw_admin/salw_admin/__pycache__/__init__.cpython-310.pyc create mode 100644 salw_admin/salw_admin/__pycache__/__init__.cpython-38.pyc create mode 100644 salw_admin/salw_admin/__pycache__/settings.cpython-310.pyc create mode 100644 salw_admin/salw_admin/__pycache__/settings.cpython-38.pyc create mode 100644 salw_admin/salw_admin/__pycache__/urls.cpython-310.pyc create mode 100644 salw_admin/salw_admin/__pycache__/urls.cpython-38.pyc create mode 100644 salw_admin/salw_admin/__pycache__/wsgi.cpython-310.pyc create mode 100644 salw_admin/salw_admin/__pycache__/wsgi.cpython-38.pyc create mode 100644 salw_admin/salw_admin/asgi.py create mode 100644 salw_admin/salw_admin/settings.py create mode 100644 salw_admin/salw_admin/urls.py create mode 100644 salw_admin/salw_admin/wsgi.py create mode 160000 salw_client diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..20ed10f --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,28 @@ + + +services: + server: + build: + context: ./salw_admin + dockerfile: Dockerfile + container_name: server + ports: + - "8000:8000" + networks: + - app-network + + web: + build: + context: ./salw_client + dockerfile: Dockerfile + container_name: web + ports: + - "3000:80" + networks: + - app-network + depends_on: + - server + +networks: + app-network: + driver: bridge \ No newline at end of file diff --git a/salw_admin/Dockerfile b/salw_admin/Dockerfile new file mode 100644 index 0000000..f248dc7 --- /dev/null +++ b/salw_admin/Dockerfile @@ -0,0 +1,20 @@ +# Back-End + +# Use the official Python image +FROM python:3.12 + +# Set working directory +WORKDIR /app + +# Install Python dependencies +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +# Copy the rest of the app files +COPY . . + +# Expose the port for the Django app +EXPOSE 8000 + +# Run the Django development server +CMD ["python", "manage.py", "runserver", "0.0.0.0:8000"] \ No newline at end of file diff --git a/salw_admin/db.sqlite3 b/salw_admin/db.sqlite3 new file mode 100644 index 0000000000000000000000000000000000000000..db9f8ad967c498ce53c9adaac4f9ce609a68726a GIT binary patch literal 155648 zcmeI5e{dVweb{#ikRS+PAAbsxC`uqjisDfO_XmFREbBlLqA2l)L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p+_-2mk>f00e*l5C8&?iomIZ3qIX%XYB1P z%SKwxwY5}k04Df6LV!NI&hHid5-*C(cSnzwHQOUChghNRF-)^+K1oP zFn*fhf&Q)!g&Pb54rG~Y0O3gLmi_!0c%K_jqz;-4JGj~hI&$cYjB)Ih`8 zKBI7S7(X8HKxe(9_@RIVE$$pAS}c3x=qC67??-D4`Z0PF{Q!LreH(oXuLXPsy@tMk zK8HSyK8f!L_%ZZR^c(2I_|AYYpkGGYD2G%OM^B?QYzQwP00e*l5C8%|00;m9AOHk_ z01yBIk0XILhH103u*`S+>DzaX(zkCMp>JP5Oy6F2)3?_S(YG)4(YIH6>D%Xf=-cPI z>D$X)trnJjUnh}Uh{)?4k?SrZuR4ibbr5->gUDGsk!Rb9^x25y+lZWOC33<_g`kf~3A*X(0MBh(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o2B!Ke3=dzo57{ nH$Jf-Q$IdFGcU6wK3=b&@)n0pZhlH>PO2S9OED9WU||3NQ?wS4 literal 0 HcmV?d00001 diff --git a/salw_admin/pssm_api/__pycache__/__init__.cpython-38.pyc b/salw_admin/pssm_api/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..41b966ef00bfd41b14d9432f7affd9e32a2c45e0 GIT binary patch literal 154 zcmWIL<>g`kf~3A*X(0MBh(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o6vWKO;XkRX-=c zG%-`(B|o_|H#M)MSl`Lh*;zl>(I;HLI5DR@J~1UXGf%&uxHvaHu^>}FK0Y%qvm`!V Xub}c4hfQvNN@-529mwF%K+FID%;Y4T literal 0 HcmV?d00001 diff --git a/salw_admin/pssm_api/__pycache__/admin.cpython-310.pyc b/salw_admin/pssm_api/__pycache__/admin.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..353fbc1bd369f8442743f7af51de921046d19d63 GIT binary patch literal 1232 zcmah}yKdVs6eabf-%Xtw={xDBCHaA(NYJ6k5TmF!ErcpEh62e_uWS?7;<;4W=`sanWk_UfG-%Y~L}s}6Fwvf{d`J7Q7q7S*$e8$VG+Ho4^# z`6f6olCiE$_q?c*bSg*F5;BV4k46{rgRaXNq!{m=T|$;76Zy8BO{No}$NZ$4Dv z6vyHLf@U#SEOr!+UFD!2*R+7=M~gb8Y;L1P$k&5mHW)LQ83yQWm9}Z6$7x&Lcy#0uho`u882QkpQau9l*Mut*j3_~A$R^`^&*BN@ zQvM=95X^G~2U^=H6&@ptvikN!*4<_`p)X--`|;ZNpwl`rflkZMNgcUxg!|wX!6Cw3 z#jr=*bAol(Y?$^E2{H~|5KuIXdU01>C6jS^oR)M6K7xbmCcx&@c@5N2Kz|FMkAska zd^ZC082eO%X*Wo2L$|74TK$X*XP*mqV|WMrH^W>2 AhyVZp literal 0 HcmV?d00001 diff --git a/salw_admin/pssm_api/__pycache__/admin.cpython-38.pyc b/salw_admin/pssm_api/__pycache__/admin.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c61bac3fa26d5c1a4bc04824cf475cac045ce27b GIT binary patch literal 1324 zcmbVM%We}f6dlhyX&#i8f}kL=oK5EkD%4UWREb822qDeJ8pduIG@c396IETJ@*%M7 zAMh>Svg$9e;$A0BQ?(!!OFr@SaeR+`kLP{A-*vFT*Wu*3=QzJ8SZx6Yd)W0)1mOr) zIf`YBIl>iQG@h>cyUY%SD#!i9T{Tv)~3|Fm{sR1*&%vW`bO( zvc6yx1tvUH`9x|nI8@WTX!*EpprrWicznd)N!`q#z<7QC7|J5A`9U+Q+m$8DxS;)4 z8)ewTuJ0j8Cu73NT){F=xTwc7YxC6mBqwoA(3Wi_O;D1c(YbG8&g)!B&P|td)reU| z;~wWdR3`gE=oPE^3!t%)-jcZ-@ECjM#;2lW_g*uYKobXb*s~thX)7gc>m3Z zROi(Rw|9|FwN^ZzmZ=SQrl-)seSFgHBE+tZ?|i_G>vw7odhPw&`bXj|q)F9fVv7Hsm^Qm!+RPUome)61HymU08=p#- zFnEN29VG$u@fQXJLj)5oifQ5ogoLu5+#Z1~tVWfHXc%I*U%HeRp&>lZG$v2)q6!cAEFh;l62*7|Fmh*^n_Q1dav1TA* z{vjd<w?~tznwCY9rE_}en}fj^-CiQZEaJfMH;)83kpuy9%_0|ER6A&g zPuAv>D%(n}uHaP{X&J&xn3oV68{TES5Z+DF8fy!pR|T)RBoClSe?$>V5sC=8ENf>IBby(y4bp-q`vyLRZ{joL z>d9B=$(h(f9hh%-{=WIS@AWziW&E*@zVQ7fV^7ZWvf#uNc^h zzuTb&&XjqrAIxGNulEN3D* zcV|pGD3U*_>?hfpc&qkna4DI4_hdWl|n|OA8usJRb aThe$2%F1UHcdH$BEAX literal 0 HcmV?d00001 diff --git a/salw_admin/pssm_api/__pycache__/models.cpython-310.pyc b/salw_admin/pssm_api/__pycache__/models.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..e715ea43b694381c46221a301e4f0137415e98fe GIT binary patch literal 2519 zcmcIm&2QsG6t|tku^lJ!?Mh-lW)Y>F#JI-G? zSbmx?cnq(SAeh74)S0@8>!R+ZUgCZ4um)@X?yx3zPaD5Ak|tPM%m<5KTUuagvj8kX zZSlbpvIs0uZE1t0!(y<+wIyKQ&>3{k;k(YjHU2bbJXMDy94|i&7(9ko{Q`nJiOZbC zDbFVQWZo9mwF~C3EYh4ZqVppdwT@Goy#OVqrOru~zao?|<4dkfnT=f7 z>heJy-+g#5d=S4nr_K<*bcp+Cp;Hb@Q}J|s=E!?6;qUETS`@p5Qd2?;v0K5jQ_M`8 z5Tzv{G4ADo@ZEW@3V)||9S+t^KuAWXoDdTc0;|gu^_Y;CB~2@j#MLI;KcVtK@RZ37 z97lF9YcMT)b`y^BVkX7pM4Rx4zt)wr!?+qrQD~88ru&p?ek7*6_Eku6MyNIoh*xgG z-u7fm;%&5Hf?M#a9*Dq+-OJymXMHOfaq$BzcmqZRH48#uK~%G#11yLaEa=uO02m88 z(qyP}DY%k&J0!+7UlWx_Ri0f5m&rMj9h?xN=z>_8a*0QiYbe%HY@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L^ABCT6jceG6Jc~{-Xk#C`RfC4kA9-^>03=TwE zWuiU;Rc)i|F^Weh-bV2biaXQtE_iXb8i{6^7Ehu5|4hpF!{Jl%1J|-p$EWuVqrM?r515^&WIu$*9e(P3s5Xz${%4CE9O?9#;Jt=#WJd1>Gd2<7z=2-u z^I!$nVTJ3B-H{Rr&B#C&S&q;??s=v?RdBi0j6CBr(=0Oayx}@J>Fy;sAOH!wXj>J5Mmq1j6iMWIX~#R zY6rG9e{@t#PT;o7(e{+8TqI&jp|))2ii(Ug9CXUlDanDv=MOJC{~vwSv9S}?r^ZX|CRa-CND_ME*|zHJTMjr-(6o+!V;P2?FA-aXEYnj z9d=TdZ%=B|c#1z+wq9C(R(P@Op%sq0jg*Z4dHGZDCH}qG+8eokZ8L;7*!2Garu;sR literal 0 HcmV?d00001 diff --git a/salw_admin/pssm_api/__pycache__/serializers.cpython-310.pyc b/salw_admin/pssm_api/__pycache__/serializers.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..934154e8fa0820ea9711cef311d48fe252f3746d GIT binary patch literal 608 zcmZ`#O-lnY5S@JNcCFhML=>baZ@p~)fJniErGH_cF^)rww>)cKz660AG|GABo8bug?%PXl9{eIb)!?7M52c7Yyz} zOC5cHjtqN}?;?+MJcB`Ni!(4_;nW*f7Pj0N=eMXrweEB_8>_qJda-h)@ekB`d;}&V zy#5NoK+ZJe9EF(XD8%1+F0?=q87`;ZS9_w_Ug{SmDL0hoN0dh7QZsbSkxXp*|Bz*4 zvnoPMslr;NCWAO6N-c`YC>7dDRZG3L6sJnPtP8t)akRY<;iIu3o|ndI{|PR|Y6IW> zVNut^8vU!HE{8{J%IdcuNi)J`A0s3nS;AZw!^uFp7LgS5Z<4pjkT>8K@d;ga!Fo5q*_4)TM9vhT$aUMHM(i)ZiCoseHmYAubzAb zPtK&!7Sw_Ln4iq|%}j23y$%60$??M;CFB!>Z3`e6z;g+JB8nPP(wtJFnBs<&Jm-{L z5*4WMov2XLr(ntRP_;4=x4)o=#MJLPZ3}6Ng|_YsR4~_{WZ6gzt9m-Og?4xN>9%nQ z2JqY=fF?OrBxfK*6$2r*WI0zHL;`;>ajskwWoxNll&IWL?r%|Qo(GD;#0<#z;^-f; zWTfZPw}p_#2r-UZJ`!RoOD%-&2vJt5Ht2VSc&VjXRV-f5hfvhUx9$sVl=~pI3)u#~ z&(p`M)TyazS)>=$U0v$w+@`)<2a8yAROUZsx-;{0EB2yh!esEk{io-mz;wgTeH4Hhv=Z?KOAL# z3;$qSs;lWJ5Hp+PbOlIQnoslCnQtC$Mx$8J_wmh><#%6*A8g$H0y3VHn2taR1(m2F z1z_E)yxLEF(tQ-HEmK+d(w>WlRg^~B*Pufszj~^tqA%hzqzm8W&S)W(ia>ozaCEa@67 z*?yHIFSFO$G#6NCb4Iz+=(W;VcwBn-(e#4l1FL(Wdmok(1s;*i8#e2l2Ljmov@@^wLh_aAaxnvK8* z6!{Apu zV-wndOW=?_BZe`<0mC5!ce8~FX?A+c?zU@ayH~CWmwUvI9~1lsH9q3Uf8#jbak%Mm ze=*0xJ)mPbCT%uMr)rh2m(5(go!1TJnfY#2$XB%o`*3OK48=L}ZLQos#gMD<_OQp` pcEF2sBOo)}8Q(3!?I3ze`4^Rb#=o3l*H8>$0ujVs46$Sx!ymXsyl?;j literal 0 HcmV?d00001 diff --git a/salw_admin/pssm_api/__pycache__/signals.cpython-38.pyc b/salw_admin/pssm_api/__pycache__/signals.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..034d17feacd5c6d848381134a4dfd7adfa30897f GIT binary patch literal 969 zcmb_a&5qMB5VrH{PFyk&)9Dw`zt{59JlEZB$K>i znx~wT?Ny%kQy*<#234TLG}Iy$x|jA`JglNLQoiCUl;VdcdoudYzVWp0e8Tzqa^QRe z=j%D&P>!5$D8qzJ#y6OmO}HJljp;I}D%B~Z5vW3y7Yc4T#eFMgI-e_J4`#Z}i!MvL z21?@ZlH_gnUYTYEg)(P&R~S`G1%*dXZx>e2Xurm7o+5nZO9oFmzVxnrvX|aZPW(F9 zF{(0QYkoEfZCFxv>ovv(ZQd=cD9xv`QdWS{&4pU~5aFXXDr?i_b%BA;mpRPMn!!B` z{5gpijaG5htnxB`)f6kO>dwS3XQ!ue^5V^TZ1U(B<228KvrL@*{eAUGtTx;AhhEqnY=q5B_$ z|8wPp(zSh|50T%ZP?Xu%qGs)DIz~PjrN?ra*Yjp7KTdUnx6O3> z1wgZ84|n0x;1CoGpoy|#a}+`(Kpz4<0@pXn15_|jhP{@#=DEH_&+z`LQYSR%hWsNw N;zvC427Dkk`!5x0*;xPp literal 0 HcmV?d00001 diff --git a/salw_admin/pssm_api/__pycache__/urls.cpython-310.pyc b/salw_admin/pssm_api/__pycache__/urls.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..9b78a24afa7adfcd4b6de7bba043e811fac12695 GIT binary patch literal 319 zcmYjN!Ait15S^s$w%YFEWq-h154JzBh#+_p5rjSTvIG-qC22#_D(*k{4|?>M;?dLo zf*?2}xa>gQ%;ODj9vSBIW5D{XPTMO6@I~aX5+oP+{0c#WWEu=>7z4>=q`8Tj=x>g7 zYy*Fl{J8Ga zGYZKQcE4Q++tv5~dc9rj=QEAVWY-I$Zpt*|@=^5dP)$yI$I;$Vco!oC2&wQJvJ5%u wm|#?{_aESL+9CK}*23D_VxA2hC7a5=gluI7IcarHi9P*R0R=1gNs|5i0u~QaC;$Ke literal 0 HcmV?d00001 diff --git a/salw_admin/pssm_api/__pycache__/urls.cpython-38.pyc b/salw_admin/pssm_api/__pycache__/urls.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2652c4ba27d084a5797ec0a7580052a18e4b2d56 GIT binary patch literal 355 zcmYjMK}y6h6iw20I@-?Q#tXRX!sY-DqE-Z95MfZEn-V6W6G_^Vv<}W4yu-NkN^$9G zt{@2h2#O!_{(rpB`!9Es$v%R5&yVUWjL?TC|0@D=2G7m_IO13#jZ2IXCp=I@2W9Xx zhbq*hBp3W_wN@AH(DX(MJD0Y< zmtqY<^aR~*rmT~6`K!~-^lv^^uvQ;q!#9S}mw*2PWxdyBxG=dP^^^i-IoB=MU5}wXPV~vY{QMu6#6q aEbpG(c&1xEC~@llWyb(1PDvUae0>8LWM8lV literal 0 HcmV?d00001 diff --git a/salw_admin/pssm_api/__pycache__/views.cpython-310.pyc b/salw_admin/pssm_api/__pycache__/views.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..78abd673f9d8b1fc28be309d5f990d7e6090c1c8 GIT binary patch literal 573 zcmY*XJ5B>J5ViN~ge0T^Buct8$psJsAwWnFMT$h>##+`UZ18^K*(C}s90W>Ez+JYb z$`z;>XC*$fn$epX>+O58^KQ3IFg}I{volJ_r)~a*hs`l2oMVwhQcY6IDYe+qPU>|5!O4z=H|_YEf+j}8C; literal 0 HcmV?d00001 diff --git a/salw_admin/pssm_api/__pycache__/views.cpython-38.pyc b/salw_admin/pssm_api/__pycache__/views.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5a814697ecfff0c3dd8f6e7de9db4c0c16b3eaf2 GIT binary patch literal 607 zcmY*W&2H2%5VrH{-L^|Fs1iqRd)d4|g<6&$Rcfo1B0%!RGO^iavE!{LVO6g1AaLvx z@GiOb)K}odIFZ^i(Tu*Ci9UVb_`|`$lwkZ>yj;JfgxrPZX(ZU3V8S~riYRJ`rJT}$ zBNN$}$B1K?dX`y(1wpG`Juq}d6nY~2)F^e*JKF212aSZr^6jywz#!V57vrNiWMKIMmMBb&8bz?JiD)wSTm zMf#c7(26e}ZS9=@>f_edf9uF3!{O(aFf&3SvbqU|0sV%&jJZM9xwDNyd4Bl I`*iq{e^(QnegFUf literal 0 HcmV?d00001 diff --git a/salw_admin/pssm_api/admin.py b/salw_admin/pssm_api/admin.py new file mode 100644 index 0000000..2db93cb --- /dev/null +++ b/salw_admin/pssm_api/admin.py @@ -0,0 +1,24 @@ +from django.contrib import admin +from .models import Images, Impact_Stories, PSSM_Resources, African_Countries, PSSM_Countries +# Register your models here. +@admin.register(Images) +class ImagesAdmin(admin.ModelAdmin): + list_display = ('title', 'image') + +@admin.register(Impact_Stories) +class Impact_StoriesAdmin(admin.ModelAdmin): + list_display = ('title', 'file') + +@admin.register(PSSM_Resources) +class PSSM_ResourcesAdmin(admin.ModelAdmin): + list_display = ('title', 'file') + +@admin.register(African_Countries) +class African_CountriesAdmin(admin.ModelAdmin): + display = ('name') + ordering = ('name',) + +@admin.register(PSSM_Countries) +class PSSM_CountriesAdmin(admin.ModelAdmin): + list_display = ('country', 'recsa', 'ecowas') + ordering = ('recsa', 'ecowas','country') \ No newline at end of file diff --git a/salw_admin/pssm_api/apps.py b/salw_admin/pssm_api/apps.py new file mode 100644 index 0000000..0ee0f09 --- /dev/null +++ b/salw_admin/pssm_api/apps.py @@ -0,0 +1,9 @@ +from django.apps import AppConfig + + +class PssmApiConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'pssm_api' + + def ready(self): + import pssm_api.signals \ No newline at end of file diff --git a/salw_admin/pssm_api/migrations/0001_initial.py b/salw_admin/pssm_api/migrations/0001_initial.py new file mode 100644 index 0000000..e9edc7e --- /dev/null +++ b/salw_admin/pssm_api/migrations/0001_initial.py @@ -0,0 +1,67 @@ +# Generated by Django 4.2.16 on 2024-10-16 07:58 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='African_Countries', + fields=[ + ('country_id', models.IntegerField(primary_key=True, serialize=False, unique=True)), + ('name', models.CharField(max_length=50)), + ('iso', models.CharField(default='', max_length=5)), + ], + ), + migrations.CreateModel( + name='Images', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=200)), + ('image', models.ImageField(upload_to='images/')), + ('copyright', models.CharField(max_length=200)), + ('description', models.TextField(blank=True)), + ('uploaded_at', models.DateTimeField(auto_now_add=True)), + ], + ), + migrations.CreateModel( + name='Impact_Stories', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=200)), + ('file', models.FileField(upload_to='impact_stories/')), + ('uploaded_at', models.DateTimeField(auto_now_add=True)), + ('description', models.TextField(blank=True)), + ], + ), + migrations.CreateModel( + name='PSSM_Resources', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=200)), + ('file', models.FileField(upload_to='pssm_resources/')), + ('uploaded_at', models.DateTimeField(auto_now_add=True)), + ('description', models.TextField(blank=True)), + ], + ), + migrations.CreateModel( + name='PSSM_Countries', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('recsa', models.BooleanField(default=False)), + ('ecowas', models.BooleanField(default=False)), + ('trained_participants', models.IntegerField(help_text='Number of participants trained')), + ('pssm_instractors', models.IntegerField(help_text='Number of PSSM instractors')), + ('senior_pssm_instractors', models.IntegerField(help_text='Number of senior PSSM instractors')), + ('modefied_at', models.DateTimeField(auto_now_add=True)), + ('country', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='pssm_api.african_countries')), + ], + ), + ] diff --git a/salw_admin/pssm_api/migrations/0002_rename_country_id_african_countries_id.py b/salw_admin/pssm_api/migrations/0002_rename_country_id_african_countries_id.py new file mode 100644 index 0000000..940a376 --- /dev/null +++ b/salw_admin/pssm_api/migrations/0002_rename_country_id_african_countries_id.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.16 on 2024-10-16 08:01 + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('pssm_api', '0001_initial'), + ] + + operations = [ + migrations.RenameField( + model_name='african_countries', + old_name='country_id', + new_name='id', + ), + ] diff --git a/salw_admin/pssm_api/migrations/__init__.py b/salw_admin/pssm_api/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/salw_admin/pssm_api/migrations/__pycache__/0001_initial.cpython-310.pyc b/salw_admin/pssm_api/migrations/__pycache__/0001_initial.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..6e43948bf9422b77779feed31331d39bfa4b2582 GIT binary patch literal 1833 zcmb7FTW{Mo6qYE-mM=-1G)>!V>)c)AUF>wv+t9>WhM;ILEP3(^!RXKmU0GBqd2Rf< zz2=APpX_a~17G))KQIg(R_u_Hb3uoplOdYlx$+!-q~y|4)4^v;t;D~!9Orifu0KA4 zNBHJ_9KZoLai;Fbosto84JL^<^1pS!1OF!neC|$yAH7ikJ`jL@u>+5f}~8b>L$*OA6JtSeYZCYh%F^ zK*AnOS&XTP08I||dcJP6Ss`hpI4d})IvT6cc(i}u>O|(8nyfk~M3L}|UyLTeRmOZ? zw}1Hn7t@$!iDWqM@nSosGw1BlCbotZk4tiC@WA}rcdQ_$^i88 z!8Bu0L5~V)JLHc=!sjcZl;)*$pqIZpI(kCC=eeAzi0AW_EYGJ@E%3tNs?&kuQOey!RNIqw|UN00ADXt`Ast}RLSX$)s`-ijX30GY??p~L7D`QjcDNiz5@E3*d*vul$ zQ5)g%^7-bKyIE!Tnoi%zc`Br$uQ@%qaw<)_ulcsjRfD@|`ljm@bLN{i6w5@PRrD$~ zNH3&9L#7n(Cth$(3VGPu&>^+^NvUp9iVJQ(q_1$z z58y}jQ1T>f@xsbk^wK&-^SbS>*Q4X$1uf=77E z5k9~IJF!xGYNyWBu{CxQcj|pQR5*00&&!oVUOR4{!g}ojK4zNgJBb zI<*nC4eCG_dZ*6JiCtJab&T&ate~!ge%iYatEV2?uNnIrwf8!rF5HA$Cf4n1x;uz^ z=zG`bHV`c#dQGFaagpWqSIF`P`Yyx0I?J_4a4k#hU&MX$mE#WnSKRym8uu-%a0R>c zw%O}D*U-C&TJRpcZ*&g~8rJ9ogFdX$M~E(Z1Ro>n)7AOfyg9!yUxyI{W4qesF1xtxI37^mt)s|E+lCT9; zjWT0TORBt#r1b0)WYy3{7Lw;-LbJFyRxXoVS!cf1II0PBM#`iRJ%fdQB~)X^XaY#s zy_Ce5+F_uay`7<_dZa9P7zs)W3ZjX|qNP20-&1kKB@J~}sJMh{G)_qPgJ+Er4W(=rB(WjKMM(fTHZ@@ z5*6X3;HE>~j3soj!YZk(q=8!gdNSD$zoC+sBBFA!l1rI};vAnFTz1+QG?HX!i@s?F zjrcPn)p{Wa%dnE1h=N5dCs`pE_YTVRh>8K94X(-uwXxprF-`KYpwA1{H#W{ivQC8ztBPL;{vCEu<-YH*6WZ>m`{XR%>Ik(`Z4O|MFW^g=4M zc^2aNL<_2%f*%ZTsa9y_8HTD8h8VF-D6V^9__QR6o;0E+%UFTjQ$3(L&46YRh7*o% zU3YAVvagRl;ToRoWd)6?*wqA6?eQ_Gm%VKkZy~oTMaK}YHaf)CRm-Ivq}?G)X|37C zc~{HcHs=W?S%o^gTu>HgkMY%Lz?@_;R}LJhmf0Q>Of|<_lkwKh7plW^TA$B9Sz;S& zG>;bt!7)#1knobQV24L#N^#u5_TG3LOt!xIE|4VAEKFGzoOd<2JnMta&CQ2l-I@_{ zTz^dT>mmUkEyr^_&$At8&0es19EsfR@)xQ@g>t2)niIUELNR0QLKhW}5lX2Kk y?P~ucI5IP-#&GvSII6x$qw~&)&vXlPwU^DPR%4W@)~6K>KG)Nf+N^K4+I^Fn!t=0sW#Sc( zP&ucqT8WG9^xd8P`93>UzaJB{PkWM=l#nl<99n?M1id-O00d}3N}5tirUV%9Hv(MI zIeXlY# z1*#B6mdZs{0b69$ON(ZBSR`5~go}m1<;y}L?g{a{l!f2uGf=fMpiG9xScXd6@xAiR zTdfLkaaF7B1$+=Yz#>j+7nr<`hFj y7!TG#$f*B<-)PU2mk`;EzBW|MER{#{U2qE0S{n literal 0 HcmV?d00001 diff --git a/salw_admin/pssm_api/migrations/__pycache__/0002_rename_country_id_african_countries_id.cpython-38.pyc b/salw_admin/pssm_api/migrations/__pycache__/0002_rename_country_id_african_countries_id.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..29069da89009ca19431f96cbe53e26100377d080 GIT binary patch literal 581 zcmZWl%}(4f5VqrF31Jb1M?hTmf|s7Fin6E(iE;p;O1W5W#@%}5pETYGac-}DkUkGL zUwi5+AR#)=E&{1z&FGsM`x}3Av%OsrwEJ#nZYd#uQu5kzOpejRJ_aB_4Y9PQl$;UB zfc+%E6kTLLSe-$BO(w-(yhkQ9R#wkDxzyf;CY4@Wfyps?IKZGtO@ZKZI;S;L`Jza~ zkVEl{VPym(q}_;{pPu<9SuEQStdOma0!!1waS5V4UXwD zR1&wYRBC?I%0R4qtJVwnO}bs|58=V`Z{8|yd@nUW^-XV;TLyk|KAZ9D4;P<#kmgoM zu-frwnfzs$90k7>-7sh^Giek5DaYbrd)F}>JVFm|FqABN%8Q(4={)97L-!JQvIz_6 e=Kc`A3`&Oj%b!g`kf~3A*X(0MBh(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o2BnKe3=dzo57{ yH$Jf-Q$IH|y(qCHGe56bKR!M)FS8^*Uaz3?7Kcr4eoARhsvSsoF%ytrVE_P_ZyN^y literal 0 HcmV?d00001 diff --git a/salw_admin/pssm_api/migrations/__pycache__/__init__.cpython-38.pyc b/salw_admin/pssm_api/migrations/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..4a575deb04c95752d178707da1b106c15ede8f4d GIT binary patch literal 165 zcmWIL<>g`kf~3A*X(0MBh(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o6vDKO;XkRX-=c zG%-`(B|o_|H#M)MSl`Lh*;zl>(I;HLI5DR@J~1UXGf%&uxHvaHu^>}FH#5B`u_QA; iuUJ1mJ~J<~BtBlRpz;=nO>TZlX-=vg$d1oI%m4tNs3{Ww literal 0 HcmV?d00001 diff --git a/salw_admin/pssm_api/models.py b/salw_admin/pssm_api/models.py new file mode 100644 index 0000000..2c8f20f --- /dev/null +++ b/salw_admin/pssm_api/models.py @@ -0,0 +1,52 @@ +from django.db import models +import os + +# Create your models here. +class Images(models.Model): + title = models.CharField(max_length=200) + image = models.ImageField(upload_to='images/') + copyright = models.CharField(max_length=200) + description = models.TextField(blank=True) + uploaded_at = models.DateTimeField(auto_now_add=True) + + def __str__(self) -> str: + return self.title + +class Impact_Stories(models.Model): + title = models.CharField(max_length=200) + file = models.FileField(upload_to='impact_stories/') + uploaded_at = models.DateTimeField(auto_now_add=True) + description = models.TextField(blank=True) + + def __str__(self) -> str: + return self.title + + +class PSSM_Resources(models.Model): + title = models.CharField(max_length=200) + file = models.FileField(upload_to='pssm_resources/') + uploaded_at = models.DateTimeField(auto_now_add=True) + description = models.TextField(blank=True) + + def __str__(self) -> str: + return self.title + +class African_Countries(models.Model): + id = models.IntegerField(primary_key=True, unique=True) + name = models.CharField(max_length=50) + iso = models.CharField(max_length=5, default="") + + def __str__(self) -> int: + return self.name + +class PSSM_Countries(models.Model): + country = models.ForeignKey(African_Countries, on_delete=models.CASCADE) + recsa = models.BooleanField(default=False) + ecowas = models.BooleanField(default=False) + trained_participants = models.IntegerField(help_text="Number of participants trained") + pssm_instractors = models.IntegerField(help_text="Number of PSSM instractors") + senior_pssm_instractors = models.IntegerField(help_text="Number of senior PSSM instractors") + modefied_at = models.DateTimeField(auto_now_add=True, blank=True) + + def __str__(self) -> str: + return self.country.name \ No newline at end of file diff --git a/salw_admin/pssm_api/serializers.py b/salw_admin/pssm_api/serializers.py new file mode 100644 index 0000000..b6d43c4 --- /dev/null +++ b/salw_admin/pssm_api/serializers.py @@ -0,0 +1,7 @@ +from rest_framework import serializers +from .models import PSSM_Countries + +class PssmCountriesSerializer(serializers.ModelSerializer): + class Meta: + model = PSSM_Countries + fields = '__all__' # Serialize all fields; you can specify a subset if preferred \ No newline at end of file diff --git a/salw_admin/pssm_api/signals.py b/salw_admin/pssm_api/signals.py new file mode 100644 index 0000000..1e3f46b --- /dev/null +++ b/salw_admin/pssm_api/signals.py @@ -0,0 +1,26 @@ +from django.db.models.signals import post_delete +from django.dispatch import receiver +from .models import Images, Impact_Stories, PSSM_Resources +import os + +@receiver(post_delete, sender=Images) +def delete_image_file(sender, instance, **kwargs): + # Check if the image file exists and delete it + if instance.image: + if os.path.isfile(instance.image.path): + os.remove(instance.image.path) + +@receiver(post_delete, sender=Impact_Stories) +def delete_impact_story_file(sender, instance, **kwargs): + # Check if the image file exists and delete it + if instance.file: + if os.path.isfile(instance.file.path): + os.remove(instance.file.path) + +@receiver(post_delete, sender=PSSM_Resources) +def delete_pssm_resources_file(sender, instance, **kwargs): + # Check if the image file exists and delete it + if instance.file: + if os.path.isfile(instance.file.path): + os.remove(instance.file.path) + diff --git a/salw_admin/pssm_api/tests.py b/salw_admin/pssm_api/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/salw_admin/pssm_api/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/salw_admin/pssm_api/urls.py b/salw_admin/pssm_api/urls.py new file mode 100644 index 0000000..48547a4 --- /dev/null +++ b/salw_admin/pssm_api/urls.py @@ -0,0 +1,10 @@ +from django.urls import path +from .views import PssmCountriesListView +# Import views from pssm_api (create them in views.py if needed) +from . import views + +urlpatterns = [ + # Example URL pattern + # path('', views.index, name='index'), + path('api/countries/', PssmCountriesListView.as_view(), name='countries-list'), +] \ No newline at end of file diff --git a/salw_admin/pssm_api/views.py b/salw_admin/pssm_api/views.py new file mode 100644 index 0000000..0f8b137 --- /dev/null +++ b/salw_admin/pssm_api/views.py @@ -0,0 +1,10 @@ +from django.shortcuts import render +from rest_framework import generics +from .models import PSSM_Countries +from .serializers import PssmCountriesSerializer + +# Create your views here. + +class PssmCountriesListView(generics.ListAPIView): + queryset = PSSM_Countries.objects.all() + serializer_class = PssmCountriesSerializer \ No newline at end of file diff --git a/salw_admin/requirements.txt b/salw_admin/requirements.txt new file mode 100644 index 0000000..c27196b --- /dev/null +++ b/salw_admin/requirements.txt @@ -0,0 +1,4 @@ +Django==4.2.16 +django-cors-headers==4.4.0 +djangorestframework==3.15.2 +pillow==10.4.0 \ No newline at end of file diff --git a/salw_admin/salw_admin/__init__.py b/salw_admin/salw_admin/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/salw_admin/salw_admin/__pycache__/__init__.cpython-310.pyc b/salw_admin/salw_admin/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..0d4af26029e4c36b8ef7128e79d74754ad7a2b3e GIT binary patch literal 120 zcmd1j<>g`kg2tX-X(0MBh(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o2B+Ke3=dzc?|c pJU%fcH#1K^K0Y%qvm`!Vub}c4hfQvNN@-529Y|9#6OdqG005Q^7jggq literal 0 HcmV?d00001 diff --git a/salw_admin/salw_admin/__pycache__/__init__.cpython-38.pyc b/salw_admin/salw_admin/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..ef67fc45005f5057c031b2dde0458ac3bf97344e GIT binary patch literal 156 zcmWIL<>g`kg2tX-X(0MBh(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o6vJKO;XkRX-=c zG%-`(B|o_|H#M)MSl`Lh*;zl>(I;HLI5DR@J~1UXGY^>=AD@|*SrQ+wS5SG2!zMRB Pr8Fni4rKIaAZ7pnEk-4N literal 0 HcmV?d00001 diff --git a/salw_admin/salw_admin/__pycache__/settings.cpython-310.pyc b/salw_admin/salw_admin/__pycache__/settings.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8edca051c12ca65fb52de41e8668d913412e9d5f GIT binary patch literal 2444 zcmb7G-E!MR6qXeECvKdkN%|Yg7#L_>h@7;g?R1zD#a2>J{gbie26TZ&)~=mR^cU@_ zX>`kL^a6Uv8}I^L@&dZ$iWlI5VOox4C($^aA=uVxch5QBIeX52yY|ZE5(l5(*FPQo zR_3@rl0o*9hrtFs^jByQr*nu$g3UXEF7O-{@XU|=PvXzqer`Xf=h2K_K%!n8ar*3t zL%FxSUV?WX-j`5e#OrgYsFzV96Hy|$^p+<)ntLOHY#x>M%V-{5#(A``!l5f~1j6eJ zXb~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--- /dev/null +++ b/salw_admin/salw_admin/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for salw_admin 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.2/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'salw_admin.settings') + +application = get_asgi_application() diff --git a/salw_admin/salw_admin/settings.py b/salw_admin/salw_admin/settings.py new file mode 100644 index 0000000..cd6adf7 --- /dev/null +++ b/salw_admin/salw_admin/settings.py @@ -0,0 +1,136 @@ +""" +Django settings for salw_admin project. + +Generated by 'django-admin startproject' using Django 4.2.16. + +For more information on this file, see +https://docs.djangoproject.com/en/4.2/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/4.2/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.2/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-6yko*@^lc2cz(nbdt(x!&7z8x8tqp_@ymqu*_-bk-52wi1@ugf' + +# 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', + 'corsheaders', + 'rest_framework', + 'pssm_api', + #'pssm_api.apps.PssmApiConfig' +] + +MIDDLEWARE = [ + 'corsheaders.middleware.CorsMiddleware', + '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', +] + +CORS_ALLOWED_ORIGINS = [ + "http://localhost:3000", # URL of your React app +] + +ROOT_URLCONF = 'salw_admin.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 = 'salw_admin.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/4.2/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/4.2/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.2/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.2/howto/static-files/ + +STATIC_URL = 'static/' + +# Media settings +MEDIA_URL = '/media/' +MEDIA_ROOT = BASE_DIR / 'media' + +# Default primary key field type +# https://docs.djangoproject.com/en/4.2/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' \ No newline at end of file diff --git a/salw_admin/salw_admin/urls.py b/salw_admin/salw_admin/urls.py new file mode 100644 index 0000000..9f95ff9 --- /dev/null +++ b/salw_admin/salw_admin/urls.py @@ -0,0 +1,23 @@ +""" +URL configuration for salw_admin project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/4.2/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('pssm_app/', include('pssm_api.urls')), +] diff --git a/salw_admin/salw_admin/wsgi.py b/salw_admin/salw_admin/wsgi.py new file mode 100644 index 0000000..ea12e62 --- /dev/null +++ b/salw_admin/salw_admin/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for salw_admin 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.2/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'salw_admin.settings') + +application = get_wsgi_application() diff --git a/salw_client b/salw_client new file mode 160000 index 0000000..cc6300f --- /dev/null +++ b/salw_client @@ -0,0 +1 @@ +Subproject commit cc6300ff991102504bb18cdb59a8965dad50c0ac