From 652d0de15fb2e147ac24c6f2ec035206fe36b4da Mon Sep 17 00:00:00 2001 From: JTRBG123 Date: Sat, 21 Sep 2024 11:24:49 -0700 Subject: [PATCH] Add files via upload --- src/README.md | Bin 0 -> 98 bytes src/db.sqlite3 | Bin 0 -> 139264 bytes src/manage.py | 22 +++ src/products/__init__.py | 0 .../__pycache__/__init__.cpython-312.pyc | Bin 0 -> 150 bytes .../__pycache__/admin.cpython-312.pyc | Bin 0 -> 326 bytes src/products/__pycache__/apps.cpython-312.pyc | Bin 0 -> 460 bytes .../__pycache__/models.cpython-312.pyc | Bin 0 -> 858 bytes src/products/admin.py | 6 + src/products/apps.py | 6 + src/products/migrations/0001_initial.py | 23 ++++ .../migrations/0002_product_summary.py | 18 +++ ...escription_alter_product_price_and_more.py | 33 +++++ .../migrations/0004_product_featured.py | 19 +++ .../migrations/0005_alter_product_summary.py | 18 +++ .../migrations/0006_alter_product_summary.py | 18 +++ src/products/migrations/__init__.py | 0 .../__pycache__/0001_initial.cpython-312.pyc | Bin 0 -> 970 bytes .../0002_product_summary.cpython-312.pyc | Bin 0 -> 737 bytes ...ter_product_price_and_more.cpython-312.pyc | Bin 0 -> 1231 bytes .../0004_product_featured.cpython-312.pyc | Bin 0 -> 800 bytes ...0005_alter_product_summary.cpython-312.pyc | Bin 0 -> 738 bytes ...0006_alter_product_summary.cpython-312.pyc | Bin 0 -> 727 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 0 -> 161 bytes src/products/models.py | 9 ++ src/products/tests.py | 3 + src/products/views.py | 6 + src/trydjango/__init__.py | 0 .../__pycache__/__init__.cpython-312.pyc | Bin 0 -> 151 bytes .../__pycache__/settings.cpython-312.pyc | Bin 0 -> 2544 bytes .../__pycache__/urls.cpython-312.pyc | Bin 0 -> 1020 bytes .../__pycache__/wsgi.cpython-312.pyc | Bin 0 -> 643 bytes src/trydjango/asgi.py | 16 +++ src/trydjango/settings.py | 127 ++++++++++++++++++ src/trydjango/urls.py | 25 ++++ src/trydjango/wsgi.py | 16 +++ 36 files changed, 365 insertions(+) create mode 100644 src/README.md create mode 100644 src/db.sqlite3 create mode 100644 src/manage.py create mode 100644 src/products/__init__.py create mode 100644 src/products/__pycache__/__init__.cpython-312.pyc create mode 100644 src/products/__pycache__/admin.cpython-312.pyc create mode 100644 src/products/__pycache__/apps.cpython-312.pyc create mode 100644 src/products/__pycache__/models.cpython-312.pyc create mode 100644 src/products/admin.py create mode 100644 src/products/apps.py create mode 100644 src/products/migrations/0001_initial.py create mode 100644 src/products/migrations/0002_product_summary.py create mode 100644 src/products/migrations/0003_alter_product_description_alter_product_price_and_more.py create mode 100644 src/products/migrations/0004_product_featured.py create mode 100644 src/products/migrations/0005_alter_product_summary.py create mode 100644 src/products/migrations/0006_alter_product_summary.py create mode 100644 src/products/migrations/__init__.py create mode 100644 src/products/migrations/__pycache__/0001_initial.cpython-312.pyc create mode 100644 src/products/migrations/__pycache__/0002_product_summary.cpython-312.pyc create mode 100644 src/products/migrations/__pycache__/0003_alter_product_description_alter_product_price_and_more.cpython-312.pyc create mode 100644 src/products/migrations/__pycache__/0004_product_featured.cpython-312.pyc create mode 100644 src/products/migrations/__pycache__/0005_alter_product_summary.cpython-312.pyc create mode 100644 src/products/migrations/__pycache__/0006_alter_product_summary.cpython-312.pyc create mode 100644 src/products/migrations/__pycache__/__init__.cpython-312.pyc create mode 100644 src/products/models.py create mode 100644 src/products/tests.py create mode 100644 src/products/views.py create mode 100644 src/trydjango/__init__.py create mode 100644 src/trydjango/__pycache__/__init__.cpython-312.pyc create mode 100644 src/trydjango/__pycache__/settings.cpython-312.pyc create mode 100644 src/trydjango/__pycache__/urls.cpython-312.pyc create mode 100644 src/trydjango/__pycache__/wsgi.cpython-312.pyc create mode 100644 src/trydjango/asgi.py create mode 100644 src/trydjango/settings.py create mode 100644 src/trydjango/urls.py create mode 100644 src/trydjango/wsgi.py diff --git a/src/README.md b/src/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d823b330908bca727d146497d6d471890707c196 GIT binary patch literal 98 zcmezWPnki1p@gA`p^_nmA&ViAA&()QA)g_h!HmHaNaiwR0!2!JDpDDW8F(4E7)VtQ E0RCGNvH$=8 literal 0 HcmV?d00001 diff --git a/src/db.sqlite3 b/src/db.sqlite3 new file mode 100644 index 0000000000000000000000000000000000000000..daeaef30f57ca39ade0de36d15ea7681aa8fa628 GIT binary patch literal 139264 zcmeI5e{37cb;r3R#T6})D_fR%cedjdW%7| z&pR9r8U6>2{|x+Hg#T{%-+GZ_`@Lkx%;x(Cz>48sC$<6Zb>GRM?+u+9`Wx>T+3$LP z&-00aocq^Y-*o=axy*dP@%jB6?w8(p`w=#? z*&r2`&jz33gH#^q35FW8huJ_*W*Vwlf@W$(s}}RRo-dbl#e7c+k%(lX8ClY(vM%Ez zMk%cFyNq`6Xc6C)g%qJf2Z)~cmV{cJpGW1Z{#yLX#1(Lc#CCx9*ug)hI z7S@b|sS90=uv=4?caueb=LqcxLu_Drnz=t}LrbqP3()5N@NO8J$!{ol%|4>PTA{Xm zB75bnUN&&*6!Y$hPGs%IcW4(#4@9S;>iSl>3N3O|t!8ek)w80M2(_CfG?Id<*OWpz zmoEkRtXk7*`J!e`&+Cd_hlW8KX^>Bs%LQvHIZC z3;KQ#?w-ki$Ij^iHZV2Cyz(xyJSIh2D0A1-qhx04LnvO1e@x6*Gjugy^}-NoF3A&*JwG7{!-WO*0oYbv+cS%%4bVFORmAEAZMtt#;}2N z=a?PU%C4BtRn;09j2T?a1I`Y=!LIZNq6S>d&mAe+`N7lKU)WP2Ya!qD=>q-0*l{0h zAM^f|gZni1K`zUU`~S`VEB^DoANoG#+ww(*zcKvb;akIphdwv->d>{JX#3F9 z-tR*Od?5iOfCP{L5Pibb`$ zEeTR&T9BtDftRG&2>gr9gyRWO2qyz}7tual2;rHC6cHndw;cl)ajS|*`~2&gTB}#J ztWAJ08&1qX%wHDe%$UbDdwRbgAV@RO%HPU4mwDZ`(4%qxbY6#v_sF90wj2TOI^MOEZ)}Mj89b z0C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MX*jR5j;d%v>Hr zbdRZ9)2L6^eU}6(r6ms52~6@VnHadwn3ueHYI=E_y8}J08Z-5Qt{pq(z2_;7F3y_C zIO{%hmDVzwSE+5iRc9lWtdj|$#^qD6k|@kHUbcR;S%oMtpP&@fv{q1xQ1=BT9!qD# z*>IXxd=KUBo|WIjaBt5YAAwdugiKo#nWd+)pdrt{g$;zm%#LjRIJD;Mq2Xj_)%UP? zpz1gE?OH2M)xDEp#`dIjt)(HWy~3|O9h`~AB3fFF*$qw@#p=A{*gby-?6w&xdTVMh z)Hr*B4Jfeq;kvb@v~9bu=14lDCA73%+VOp)Su2e6iy6bu?hw*MxIXet zvOe;mEj-ydl3)YzIP=OJ?IBCrmeLxJwFhQB586g&J#8MSpEQPO=KZDRP8oXk9z(U} z&80C+%W9cCtRJ@CSnBm+QLVxthAd0o@fih{cUkIRD>o7z6E)01`j~NB{{S0VIF~kN^@u0!RP}Jh}vM{Qv0I9V$lx zNB{{S0VIF~kN^@u0!RP}AOR%MF996?_e%=xkN^@u0!RP}AOR$R1dsp{Kmter2|T(4 z$oSvM!EXS(4jX(S0VIF~kN^@u0!RP}AOR$R1dsp{Kmu0(HJgQB>6_(We&;)1WF|2~zAL)Al3U{fK+|5oe>)tRT80xkL}6Np&~*gjtQ46M@>0CjrH!&KJ&xM@BjOuXKsKIUxMR$y;xMM+hv>5nm20=*6y=h3wW4onTJ4OdPrHFW?c9CZx%#wo_GkAr19nruCP^t6B_=?!@O1&z ze5IBzm!1tbVbyNubsqkyO}OK&isU}UeTduSmbtSWFLjGpg%Kre`c=!%$$9h%`zSbjQ^kPbI9KjCis6UXO|@a literal 0 HcmV?d00001 diff --git a/src/manage.py b/src/manage.py new file mode 100644 index 0000000000..458f7ba283 --- /dev/null +++ b/src/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', 'trydjango.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() diff --git a/src/products/__init__.py b/src/products/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/products/__pycache__/__init__.cpython-312.pyc b/src/products/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5ac8a8c1f4230d31c53bda38de70105183fd537d GIT binary patch literal 150 zcmX@j%ge<81nsZirh(|kAOanHW&w&!XQ*V*Wb|9fP{ah}eFmxdW$J7d6Iz^FR2-94 zQk0Y)lag8%Q&Lo!l9ia3o*z?OlpIq~l%Gy65 zCfhB(l&r+O^nAVK{JfH)%%mcalWwu)=BK3Q6c@3AI4s4PC8@VKic-@vi%U|ARx*4B ziZc8%a<+;IElw>ej>#%1N=lDONiB;hDXN4R7gJo698&C%v?=mPnWsrWrz}n8$$aS4T_#%Vw1ox{9GDRS70svg+P5uA? literal 0 HcmV?d00001 diff --git a/src/products/__pycache__/apps.cpython-312.pyc b/src/products/__pycache__/apps.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..8208ad7371bb3d148001cb62e1ccb0dbfb016ca2 GIT binary patch literal 460 zcmXv~ze~eF6n>YaQu_-LEjT#12w4JdA|lj^ZpFpHaB!r(OK3@(c$Wxq6AG?w1^)x_ zPjPW90VgLBL8vaByvwCGy!U}f?Q@OHvMZm8*eGA`#Bn#8_`_hJWgSsT7F!a`fPsrBxCTY8Ne$P^ zOxwy^mpr2BAQ8I$ZkLX{Nf0@-?~EhLLgAbagHD=6=R+3Kyc(DGo?XeSgiO3KBP6d8 zBHd}IaD$MW)C)^xlQQ2+!-ROU2l0z0meQVKp~hPtbdT_rU|ir)!utWH>=q|H(_>)4 z2YB@)_TpGLamLlIieO0~nlembzH|6ywdeKi`!lX?3cY8WdAm>?Z-q2y~Ez`nt|Gn*MA^WQS}eg5qI4H literal 0 HcmV?d00001 diff --git a/src/products/__pycache__/models.cpython-312.pyc b/src/products/__pycache__/models.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3ff424fcb204029170e3e30bcd323ca26b0f6711 GIT binary patch literal 858 zcmZ{iF>ljA6vyxExUmzLbb!*32n(dD^3ny=p+X2K3KJC)g~769T;DZyI6L9&RLvHo z4q;;Knz1Mu82JvcL_|t-5))GfB&5L7iMw1wBOz{h{=av>clYl3eO_M90lvKR9|tcX z0N;f(U)qJ3ZgX)85I~TC2s#h~1v~*rIRQw;u$Gx8Tz-41)Q;N9*xE!mHe^dt9bu9L zmmC1|70c0PlqtPMi&UicGd)Gdoa~HSStO)J z8d~aS|8mBE&(o2S>@!+N%^;l|^EiKhF7l5(g5zp>xMwR& z+b4efnq}f9Arnz+xU#`Hg zp-sqPGuyIa1zk4k%sk{nUCd_7jT1y0cP2x z8AU#AG4oNqPOu-#UHt(2X_I2~0Zhe%&+qJPyDt(<6StPq{i=)bk(<&Ms`+uX?j|&F z8?q6JD<@#H(V}9yW=2dv@`{@iFgA*v)sayg7{%`Mp<%bLjSE)iXjHHU1*?lbUL6*; z+NH5k7F2m)l+PZ1S|1t@IF~PVwnq8VAYbaPpW$KtZu|P!v^tfMX$?&4t9k3~8oe>U za@Wo-27A_gx^5<*OCTrcMjf@ LcjPzVa+diARaVUf literal 0 HcmV?d00001 diff --git a/src/products/admin.py b/src/products/admin.py new file mode 100644 index 0000000000..bc181f1819 --- /dev/null +++ b/src/products/admin.py @@ -0,0 +1,6 @@ +from django.contrib import admin + +from .models import Product + +admin.site.register(Product) +# Register your models here. diff --git a/src/products/apps.py b/src/products/apps.py new file mode 100644 index 0000000000..22822660bb --- /dev/null +++ b/src/products/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class ProductsConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'products' diff --git a/src/products/migrations/0001_initial.py b/src/products/migrations/0001_initial.py new file mode 100644 index 0000000000..0c6eda26aa --- /dev/null +++ b/src/products/migrations/0001_initial.py @@ -0,0 +1,23 @@ +# Generated by Django 5.1.1 on 2024-09-20 21:43 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Product', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.TextField()), + ('description', models.TextField()), + ('price', models.TextField()), + ], + ), + ] diff --git a/src/products/migrations/0002_product_summary.py b/src/products/migrations/0002_product_summary.py new file mode 100644 index 0000000000..12c1cc2542 --- /dev/null +++ b/src/products/migrations/0002_product_summary.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.1 on 2024-09-20 21:46 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('products', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='product', + name='summary', + field=models.TextField(default='this is cool!'), + ), + ] diff --git a/src/products/migrations/0003_alter_product_description_alter_product_price_and_more.py b/src/products/migrations/0003_alter_product_description_alter_product_price_and_more.py new file mode 100644 index 0000000000..02bb38f61a --- /dev/null +++ b/src/products/migrations/0003_alter_product_description_alter_product_price_and_more.py @@ -0,0 +1,33 @@ +# Generated by Django 5.1.1 on 2024-09-20 22:29 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('products', '0002_product_summary'), + ] + + operations = [ + migrations.AlterField( + model_name='product', + name='description', + field=models.TextField(blank=True, null=True), + ), + migrations.AlterField( + model_name='product', + name='price', + field=models.DecimalField(decimal_places=2, max_digits=10000), + ), + migrations.AlterField( + model_name='product', + name='summary', + field=models.TextField(), + ), + migrations.AlterField( + model_name='product', + name='title', + field=models.CharField(max_length=120), + ), + ] diff --git a/src/products/migrations/0004_product_featured.py b/src/products/migrations/0004_product_featured.py new file mode 100644 index 0000000000..698b3245da --- /dev/null +++ b/src/products/migrations/0004_product_featured.py @@ -0,0 +1,19 @@ +# Generated by Django 5.1.1 on 2024-09-20 22:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('products', '0003_alter_product_description_alter_product_price_and_more'), + ] + + operations = [ + migrations.AddField( + model_name='product', + name='featured', + field=models.BooleanField(default=True), + preserve_default=False, + ), + ] diff --git a/src/products/migrations/0005_alter_product_summary.py b/src/products/migrations/0005_alter_product_summary.py new file mode 100644 index 0000000000..26b33cf1c1 --- /dev/null +++ b/src/products/migrations/0005_alter_product_summary.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.1 on 2024-09-20 22:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('products', '0004_product_featured'), + ] + + operations = [ + migrations.AlterField( + model_name='product', + name='summary', + field=models.TextField(blank=True), + ), + ] diff --git a/src/products/migrations/0006_alter_product_summary.py b/src/products/migrations/0006_alter_product_summary.py new file mode 100644 index 0000000000..03ceb02508 --- /dev/null +++ b/src/products/migrations/0006_alter_product_summary.py @@ -0,0 +1,18 @@ +# Generated by Django 5.1.1 on 2024-09-20 22:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('products', '0005_alter_product_summary'), + ] + + operations = [ + migrations.AlterField( + model_name='product', + name='summary', + field=models.TextField(), + ), + ] diff --git a/src/products/migrations/__init__.py b/src/products/migrations/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/products/migrations/__pycache__/0001_initial.cpython-312.pyc b/src/products/migrations/__pycache__/0001_initial.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..d90c1bbe5074c45fb8de064afa5196535e128be1 GIT binary patch literal 970 zcma)4&ubGw6rR~%+1;ciDV0djm_rc~v_!p$6tty9vBg6LSr(S<&UD$h*^RTCVmwvo zL2td)qgP4)0RIHR%Z3UGb1HZe6auXXJvp^WM$u#5%I9X!g03d*%58BXxZNU&A5WpHh!X7{(hAm~!Bj>yafK(3KI2p0!0AOH11PlQ|Lv(>52>{Ej!k-NpMgkI9E!Qeu zP=g2}3CV{_U&^Z60?MWAxxd-{$rj_N|H0Az&2gnez0b_$;X*_2Tlk7^Mnp6z?DFfHt0vK21UgPHMCN>R2w?4xL-o~Npnc3BqHEsIT}>tlusmi3}*`<%?O zoELa8JBt<&?%)97!0~WI_+)8*ITg3gXGplQwD7=l?=#t}{0ypX;+Js-^{|5{L;nCy zxDRJ5%XiJE>>`obipiF1BD`b9q=#B|;D%;I9J7;|5}D^O#%wm5x2%b##ZHg#XO}J< zL~q%$2aadwcGt!doL6=qk5!;ud!rB4>OifIN|oc%rKH^0-x-!0gL31e^l2e6tRx^` z%285`N2SY2rSb0iu+kV*8b_5IN%7{WR84Bl_sX!=9MqaewcAPY&PBYjCeP2F%BrT1 zMSV_r{fJzhYTIDr)Ut~$qOH`t)UQna6;4aJRff*gd)X+KNR6eCeGzAjMF`<91;F~L TQi969J}fQ_iVHshOVaM&k)-oG literal 0 HcmV?d00001 diff --git a/src/products/migrations/__pycache__/0002_product_summary.cpython-312.pyc b/src/products/migrations/__pycache__/0002_product_summary.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..bd15d7b43fb25c78669a7963dc64a7d578d32704 GIT binary patch literal 737 zcmY*W&1(}u6o0e3nf)MeR_FD3TqM@0k$sXggsSs1sON!+j>aduOTCxsq7 z_8|0MP}={*Q$R?Vt0xbIKq^8{&TMvx4$GV0@6CH}-|xNejfMmA>|I`VzaW60id3go zg89A#XF!3X2x8=+So1Ul8axN8odDGt>fXCS>^zkC7HjG;0zdeh=Qk4)I*-G0WvQoHgJn9d`0e)Z6X$JrX8i9tM#xOTRF)VH^j1^r4Zz4YO_eb<#At z?IK}P)(wVH?&?yal0}jrX2K|JtsAn49=f)$NZ}_$IE2W!VZ$_6Z< zEa`+S<7$e+dP3!*`Grynnqn=OMv7hr1 z?FUIO^)ue_E1CXs8NL*}N6H6M%G@1{xY}%C6v!S)a{@CA_MMrot>KRcGY9Og&(6f! z99x^y_3i2E#guQ5LmmU>53w4V> x-c(^l>@A6|t%r+Y?eh&u)jG2+X=XY?=nn?uUg0{zr_N+$XS}lW8zd>R{{liIx&r_J literal 0 HcmV?d00001 diff --git a/src/products/migrations/__pycache__/0003_alter_product_description_alter_product_price_and_more.cpython-312.pyc b/src/products/migrations/__pycache__/0003_alter_product_description_alter_product_price_and_more.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c38b1cab6d05086a2e5e53657a222b1252cc3416 GIT binary patch literal 1231 zcmb7D&ui2`6rRbi-K0NULq$`;U-kbT}_uhPO@?~sH1I(TueP7!W z0r6h40)fshCsE@ z_lT4FjVPf?*g!Z)Tz*to)(#5}79cN*fe8^X1q3~4iUPn=y+9Nh?281%&y@Q3iOqqF zBqVj@wvdM%rD*FfT&0Ywatc=&sU7XVxJJ(Et39Cqr;bK57X6ft#yaC|rWCg!lP8&4 z>zq-c>a#*^CVe?34b*hggig%O&CT0`&`z3R=#UmI4L0Zq!ih`#m``biCCaOT6TPBR z)C>YcWFzEbvm+%(3RkCfW**2@(3^4OYZTof833zoLAspif;mGxI zLioF*+Jhj)CNAPUiBK&X4 z7VadU*s=-w3Q%wLMPWjD`?RkCb!to7D^GUIlf8@AdgrHldUgB8o?h+h)ejRpOS}5r z!;++GeHo literal 0 HcmV?d00001 diff --git a/src/products/migrations/__pycache__/0004_product_featured.cpython-312.pyc b/src/products/migrations/__pycache__/0004_product_featured.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..2b63da3d194692dd64019059e80b7a6a550b5a75 GIT binary patch literal 800 zcmZ8f&x_MQ6rM@aGznW-i?B*p5ZMa3EQR%?vakv(h`Xot5&|L3do3yX@0!ttPaoX)cU>~jE^A{kT8Z_` z`dC|Hah@?UY?GTul_DX}$XE))pvd{-PN%cy`B8z)TP=EkdBDOq$)Wki(=?6HPs$~3r5Ubn z;saSoQ?8GmJ#t@(=D9m4Shw#2p1K7a!N5=YshhLFt?Y5v*XRnP9{#bYns+xFG5ILU zAVGd0!Wo(C#5|#MRk@|Vc{#U;x&6+X8m)=Znr+>i-E7U8?ehoIW_!|XzlTrFz1iLS zS7yz$=4!pEzkR`OS7#mz6V0WvUFeqcmQyafZppMV_l`i<#*?LK`>Z9Xd=2@w2y>NE Z`co&=zS0|1KewivJCn_wA4HI{`ZqqO)notw literal 0 HcmV?d00001 diff --git a/src/products/migrations/__pycache__/0005_alter_product_summary.cpython-312.pyc b/src/products/migrations/__pycache__/0005_alter_product_summary.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..1b6eb3047e9329cb07cc2ce0a095f226f50f8db4 GIT binary patch literal 738 zcmY*WL5tHs6n>MW(1aeTSFtdwK88``-JyxoLy6yUU;bPYB?LWDdNX`Y5agC{_>W1u=iBU~4)zi0XidwOoTjUS4*ny{ncfCuSt947)t zW6Hv$x2^$bR%G!?f>U7NAqt*G(Exe62Fw_h1OHnBatx~e;nAi4QaOQ-MY1T^QbB1L*gJ}!YF;CKV%_2bS+_$GERuF36XhO$Ryq%2b?hRSO)%t|} zFiaVLth#VR1*{|XE-ksR#}ihq@(V1KzU7NY_xzU$a?X(AbB9&F%%fAcA;zA`2DlO2J6O0duHxU&As`~ z&H3fsxzjqiHFH{1r}cUJo728%8kSw?*ufv3@}0Whp=$_hHCmf?OTDGW)r(hETA6!I qqNRC%wX_4iE2+9?a$UMYM+p7KfZPkbf$)hv+uEOQ?f(Kv%IZJllDm2U literal 0 HcmV?d00001 diff --git a/src/products/migrations/__pycache__/0006_alter_product_summary.cpython-312.pyc b/src/products/migrations/__pycache__/0006_alter_product_summary.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..57ea5c6019303555d6e93c639752d3a0333a5871 GIT binary patch literal 727 zcmZuv&x_MQ6n>MW(TgD;$`G<+pxl;v3RUh65hu!z>jN zCmCh2=&x%4nnsIIspr5TKokOlq5%p_1DG|c2L8K5jc-u>4v((qOJA&JAl1n( zT0WM}%Vriem_6nho%C}dcY3|veGb~nbt;*e2XlXxMt?Yo`R8;++Aa1Epnh2ra X7?6L7HxNE^XItIrR`(YuQdR!}->0~V literal 0 HcmV?d00001 diff --git a/src/products/migrations/__pycache__/__init__.cpython-312.pyc b/src/products/migrations/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..665fced553da86bbcd99433ae1adae52db7b23ff GIT binary patch literal 161 zcmX@j%ge<81nsZirh(|kAOanHW&w&!XQ*V*Wb|9fP{ah}eFmxd<=|`;6Iz^FR2-94 zQk0Y)lag8%Q&Lo!l9ia3o*z?OlpIq~l%GKEC7YJDwqHO literal 0 HcmV?d00001 diff --git a/src/products/models.py b/src/products/models.py new file mode 100644 index 0000000000..23f5421c07 --- /dev/null +++ b/src/products/models.py @@ -0,0 +1,9 @@ +from django.db import models + +# Create your models here. +class Product(models.Model): + title = models.CharField(max_length=120) + description = models.TextField(blank=True, null=True) + price = models.DecimalField(decimal_places=2, max_digits=10000) + summary = models.TextField(blank=False, null=False) + featured = models.BooleanField() \ No newline at end of file diff --git a/src/products/tests.py b/src/products/tests.py new file mode 100644 index 0000000000..de8bdc00eb --- /dev/null +++ b/src/products/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/src/products/views.py b/src/products/views.py new file mode 100644 index 0000000000..22155ea5cd --- /dev/null +++ b/src/products/views.py @@ -0,0 +1,6 @@ +from django.http import HttpResponse +from django.shortcuts import render + +# Create your views here. +def home_view(*args, **kwargs): + return HttpResponse("

Hello World

") \ No newline at end of file diff --git a/src/trydjango/__init__.py b/src/trydjango/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/trydjango/__pycache__/__init__.cpython-312.pyc b/src/trydjango/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..425d2c32708ef631c427c4ea06d0df63e9e14259 GIT binary patch literal 151 zcmX@j%ge<81YMf1(m?cM5P=Rpvj9b=GgLBYGWxA#C}INgK7-W!GIO?y2`x@7Dvrr2 zDN0I@Nl7h>DJiN<$x6&i&yOiCN=D+v$7kkcmc+;F6;%G>u*uC&Da}c>D`Ev2!wAI1 PAjU^#Mn=XWW*`dyD{Cc@ literal 0 HcmV?d00001 diff --git a/src/trydjango/__pycache__/settings.cpython-312.pyc b/src/trydjango/__pycache__/settings.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f1520b7638ea41d19af4d79399a5e679c6a30eeb GIT binary patch literal 2544 zcmb7GOK;mo5GM5&^{}icv68d^10!+d)KuIw52QgFTB02xvZR_)+!96!TDy|hrbvaP z?3gFrd+Dt`Hf6%|sON<_3@MNH;0x2LT=q0BPCD|5a19kNvcjxiV?6)&Z{vL}l z6nuVr|99i-7)AZ*PL4i-;o#$Y82n5jN}>>rJSyGtNFJKdM0k}s{P>LeZARlsd%xjv^DDukJq@@^& zN^ulJaU4Jsc7&o(;+2Qc(gd1BNwAtk7y8#!|9X+oO`nuNm!wHFB_$!=1^A~>TDpiX zOP6-9WUeY4EQ`r+Dq2%#O>9|2Ynp6BH(1NqMFVl$&^K}2;uvNLYuHdMjM(*Ec4nZS zQ&5X&tZ6BRHME>zJ0{?;L)g3AJbW2u5l~yYfmxzKfR``(wgF4b~@Yg4IjL0fR&EgDJ-m)mar znA!L)+tmbvZo)+2z{4GiH3u;~5S|x{S{WF7UZ$LMiX~ z@`V-A3GtPR+#dzYm1?0}674G|l8RFmg`@Qo2F({LvG5(6 z0pW0*@i+mYv{Wbwj<3Wo3q}vhV{NWu zI^J3}X9wZLhnC6OpATVy$(D|=YH|yt2`!~B60D+9X37c5G92cz>;&6zWU6G{@B+0? zNS57W#+4h`)YWb51ln+}XqFRN;6=gRYljhq+=@_@p9$YP{=BeITXJH2u~=Re^77NN zSQVXkp(Iv81Og}!(P5Sg`Fv4W7Dz<=RRyS1v6&;i|A)De_f8bP}uLQo*$^ z7IM5>OHMe?S9v$A=%o2t^{HIpMRB#fl9!+J#R4eHP=c`{Us|g1OM;v$=LG;PEDN$! zhLQ=@AmPINgOU?)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index 0000000000..07e3f3d9ca --- /dev/null +++ b/src/trydjango/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for trydjango 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/5.1/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'trydjango.settings') + +application = get_asgi_application() diff --git a/src/trydjango/settings.py b/src/trydjango/settings.py new file mode 100644 index 0000000000..d3a3d86a20 --- /dev/null +++ b/src/trydjango/settings.py @@ -0,0 +1,127 @@ +""" +Django settings for trydjango project. + +Generated by 'django-admin startproject' using Django 5.1.1. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/5.1/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/5.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-eg*(%!aof)no1i7*8qd#^i1#062+_@7h0vakxk_exto#d&+ffd' + +# 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', + + #own apps + 'pages', + 'products', +] + +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 = 'trydjango.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 = 'trydjango.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/5.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/5.1/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/5.1/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/5.1/howto/static-files/ + +STATIC_URL = 'static/' + +# Default primary key field type +# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/src/trydjango/urls.py b/src/trydjango/urls.py new file mode 100644 index 0000000000..f17336d610 --- /dev/null +++ b/src/trydjango/urls.py @@ -0,0 +1,25 @@ +""" +URL configuration for trydjango project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/5.1/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 + +from pages import views + +urlpatterns = [ + path('', views.home, name='home') + path('admin/', admin.site.urls), +] diff --git a/src/trydjango/wsgi.py b/src/trydjango/wsgi.py new file mode 100644 index 0000000000..09004a05b0 --- /dev/null +++ b/src/trydjango/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for trydjango 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/5.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'trydjango.settings') + +application = get_wsgi_application()