From 53a36f80eea15b6edfe9ddd010d08a879443a0a6 Mon Sep 17 00:00:00 2001 From: Jason <153796547+GreetingsEarthling@users.noreply.github.com> Date: Tue, 18 Feb 2025 08:00:43 +0000 Subject: [PATCH] Finished application --- dev/trydjango/src/db.sqlite3 | Bin 0 -> 139264 bytes dev/trydjango/src/manage.py | 15 +++ dev/trydjango/src/pages/__init__.py | 0 dev/trydjango/src/pages/admin.py | 3 + dev/trydjango/src/pages/apps.py | 5 + .../src/pages/migrations/__init__.py | 0 dev/trydjango/src/pages/models.py | 3 + dev/trydjango/src/pages/tests.py | 3 + dev/trydjango/src/pages/views.py | 7 + dev/trydjango/src/products/__init__.py | 0 .../__pycache__/__init__.cpython-38.pyc | Bin 0 -> 152 bytes .../products/__pycache__/admin.cpython-38.pyc | Bin 0 -> 266 bytes .../__pycache__/models.cpython-38.pyc | Bin 0 -> 624 bytes dev/trydjango/src/products/admin.py | 4 + dev/trydjango/src/products/apps.py | 5 + .../src/products/migrations/0001_initial.py | 23 ++++ .../migrations/0002_product_summary.py | 18 +++ .../migrations/0003_auto_20250218_0712.py | 28 ++++ .../migrations/0004_product_featured.py | 19 +++ .../src/products/migrations/__init__.py | 0 .../__pycache__/0001_initial.cpython-38.pyc | Bin 0 -> 678 bytes .../0002_product_summary.cpython-38.pyc | Bin 0 -> 595 bytes .../0003_auto_20250218_0712.cpython-38.pyc | Bin 0 -> 769 bytes .../0004_product_featured.cpython-38.pyc | Bin 0 -> 621 bytes .../__pycache__/__init__.cpython-38.pyc | Bin 0 -> 163 bytes dev/trydjango/src/products/models.py | 9 ++ dev/trydjango/src/products/tests.py | 3 + dev/trydjango/src/products/views.py | 3 + dev/trydjango/src/trydjango/__init__.py | 0 .../__pycache__/__init__.cpython-38.pyc | Bin 0 -> 153 bytes .../__pycache__/settings.cpython-38.pyc | Bin 0 -> 2316 bytes .../trydjango/__pycache__/urls.cpython-38.pyc | Bin 0 -> 932 bytes .../trydjango/__pycache__/wsgi.cpython-38.pyc | Bin 0 -> 560 bytes dev/trydjango/src/trydjango/settings.py | 127 ++++++++++++++++++ dev/trydjango/src/trydjango/urls.py | 25 ++++ dev/trydjango/src/trydjango/wsgi.py | 16 +++ 36 files changed, 316 insertions(+) create mode 100644 dev/trydjango/src/db.sqlite3 create mode 100755 dev/trydjango/src/manage.py create mode 100644 dev/trydjango/src/pages/__init__.py create mode 100644 dev/trydjango/src/pages/admin.py create mode 100644 dev/trydjango/src/pages/apps.py create mode 100644 dev/trydjango/src/pages/migrations/__init__.py create mode 100644 dev/trydjango/src/pages/models.py create mode 100644 dev/trydjango/src/pages/tests.py create mode 100644 dev/trydjango/src/pages/views.py create mode 100644 dev/trydjango/src/products/__init__.py create mode 100644 dev/trydjango/src/products/__pycache__/__init__.cpython-38.pyc create mode 100644 dev/trydjango/src/products/__pycache__/admin.cpython-38.pyc create mode 100644 dev/trydjango/src/products/__pycache__/models.cpython-38.pyc create mode 100644 dev/trydjango/src/products/admin.py create mode 100644 dev/trydjango/src/products/apps.py create mode 100644 dev/trydjango/src/products/migrations/0001_initial.py create mode 100644 dev/trydjango/src/products/migrations/0002_product_summary.py create mode 100644 dev/trydjango/src/products/migrations/0003_auto_20250218_0712.py create mode 100644 dev/trydjango/src/products/migrations/0004_product_featured.py create mode 100644 dev/trydjango/src/products/migrations/__init__.py create mode 100644 dev/trydjango/src/products/migrations/__pycache__/0001_initial.cpython-38.pyc create mode 100644 dev/trydjango/src/products/migrations/__pycache__/0002_product_summary.cpython-38.pyc create mode 100644 dev/trydjango/src/products/migrations/__pycache__/0003_auto_20250218_0712.cpython-38.pyc create mode 100644 dev/trydjango/src/products/migrations/__pycache__/0004_product_featured.cpython-38.pyc create mode 100644 dev/trydjango/src/products/migrations/__pycache__/__init__.cpython-38.pyc create mode 100644 dev/trydjango/src/products/models.py create mode 100644 dev/trydjango/src/products/tests.py create mode 100644 dev/trydjango/src/products/views.py create mode 100644 dev/trydjango/src/trydjango/__init__.py create mode 100644 dev/trydjango/src/trydjango/__pycache__/__init__.cpython-38.pyc create mode 100644 dev/trydjango/src/trydjango/__pycache__/settings.cpython-38.pyc create mode 100644 dev/trydjango/src/trydjango/__pycache__/urls.cpython-38.pyc create mode 100644 dev/trydjango/src/trydjango/__pycache__/wsgi.cpython-38.pyc create mode 100644 dev/trydjango/src/trydjango/settings.py create mode 100644 dev/trydjango/src/trydjango/urls.py create mode 100644 dev/trydjango/src/trydjango/wsgi.py diff --git a/dev/trydjango/src/db.sqlite3 b/dev/trydjango/src/db.sqlite3 new file mode 100644 index 0000000000000000000000000000000000000000..80cbee7484bfb844107f8e4e6f2279795a57dbdb GIT binary patch literal 139264 zcmeI5du$xXeaCn2wK|b^Ly4r$wj}FFiIT1~sk`0Vdr)y~TB2ymB4tU`gG!C<-rbU1 z@*dRPkre5s0A<-N+O&T(XpkakT@=V)E!x^B;69Rn5(GtEv<-@+K+?28(m#R%wOtrU z)7B}_nYq2&y$2ENC_Ebu z3xehyK+!7I(kx8DaF9?|7+|NIqb;q1wm&vLPJ=KmY_l00ck) z1V8`;KmY_l00cnb!z0k&7og61yJ7-O^(KsikyfkJv8%>GjmKci)Pi- z^DUX;V`^eFrYdncsSuv2VpJ+-smRK^O{QpkEGCbplJro@WY8=0Umd3dq2c*|@c8mJKai zDprkRwYsrlR5V)drg}__S>;j^Nj3W1Uh3k7x(n4=E)FPPS}==RaW&skGj$(wI-x%6 zr#>d@KH^Rv4K}5fYUhH;F-4A_*+V@{*FDgdXjhX_(9Qh)swkRPlF8>K>g0OeiEKGp zG0Fv#H<_JOb~2SzC)K2?CdWP06{T#sl5JO(EPndZ=F?G4 zTunvQsGGVNYPh)P`IA(XSTcIbMVZnZwe#oR8RVF%%1M!;8)`*&&y0z*oK7kMa$4|_ zAustia*gE4m&vPShzxzQF6k&O2!H?xfB*=900@8p2!H?xfB*<^0)6}3BVv8TuRh+k zhkRZ*xDB8_H_eb+(u)fvI^sYFA=s#aJLGjM^;m0=gAZm%-QDgZe%9INLuBMHg#FEa zdwuR9og#KnT$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lJNLZ@r-|VwOq{`MOx}A|5oX9VhQU-`ZE}%I?ewBI-va8 literal 0 HcmV?d00001 diff --git a/dev/trydjango/src/manage.py b/dev/trydjango/src/manage.py new file mode 100755 index 0000000000..ddce531536 --- /dev/null +++ b/dev/trydjango/src/manage.py @@ -0,0 +1,15 @@ +#!/usr/bin/env python +import os +import sys + +if __name__ == '__main__': + 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) diff --git a/dev/trydjango/src/pages/__init__.py b/dev/trydjango/src/pages/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/dev/trydjango/src/pages/admin.py b/dev/trydjango/src/pages/admin.py new file mode 100644 index 0000000000..8c38f3f3da --- /dev/null +++ b/dev/trydjango/src/pages/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/dev/trydjango/src/pages/apps.py b/dev/trydjango/src/pages/apps.py new file mode 100644 index 0000000000..acdb960739 --- /dev/null +++ b/dev/trydjango/src/pages/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class PagesConfig(AppConfig): + name = 'pages' diff --git a/dev/trydjango/src/pages/migrations/__init__.py b/dev/trydjango/src/pages/migrations/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/dev/trydjango/src/pages/models.py b/dev/trydjango/src/pages/models.py new file mode 100644 index 0000000000..71a8362390 --- /dev/null +++ b/dev/trydjango/src/pages/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/dev/trydjango/src/pages/tests.py b/dev/trydjango/src/pages/tests.py new file mode 100644 index 0000000000..7ce503c2dd --- /dev/null +++ b/dev/trydjango/src/pages/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/dev/trydjango/src/pages/views.py b/dev/trydjango/src/pages/views.py new file mode 100644 index 0000000000..f57b6e436c --- /dev/null +++ b/dev/trydjango/src/pages/views.py @@ -0,0 +1,7 @@ +from django.http import HttpResponse +from django.shortcuts import render + +# Create your views here. +def home_view(*args, **kwargs): + #return "

Hello World

" html code string + return HttpResponse("

Hello World

") \ No newline at end of file diff --git a/dev/trydjango/src/products/__init__.py b/dev/trydjango/src/products/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/dev/trydjango/src/products/__pycache__/__init__.cpython-38.pyc b/dev/trydjango/src/products/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..27a82b94365c041f5e04ac0c24d3d7bed95cbd6f GIT binary patch literal 152 zcmWIL<>g`kf-bc!=^*+sh(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o6vOzdXMvySN}R zIki~dB`Yy6J>MlYH(x&`wM@UHs4@jCqF-E;tY1)+pHiA!Qmh{zpP83g5+AQuPzZK_UJ+;4k^X~XfhN>npyXn)8tTRYQb5VrH!JT`lxf)>%BG?$JBgb=KN=1xc)O&ZIW@$Gugd0;!oE-ke88-S9Y zU*nc){{j`0Sb`frG&A3Lp8l{}X{Ev;kZ7ZBo# zZi6~ODTNpokf4;!SPB{12cPfF|FyvnXf-jt53bYHp5g&wchb=)2~I_ zS0HXGs}C@1Dx;ff@ZB<%AJge@&>^~+remfbkKQAMf`RAu_=?ja`rU}pR X{}ep;06n<$nQzN;{8z+Gy(q%J1|X-O literal 0 HcmV?d00001 diff --git a/dev/trydjango/src/products/admin.py b/dev/trydjango/src/products/admin.py new file mode 100644 index 0000000000..c8127a2706 --- /dev/null +++ b/dev/trydjango/src/products/admin.py @@ -0,0 +1,4 @@ +from django.contrib import admin +from .models import Product +# Register your models here. +admin.site.register(Product) \ No newline at end of file diff --git a/dev/trydjango/src/products/apps.py b/dev/trydjango/src/products/apps.py new file mode 100644 index 0000000000..864c43ed85 --- /dev/null +++ b/dev/trydjango/src/products/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class ProductsConfig(AppConfig): + name = 'products' diff --git a/dev/trydjango/src/products/migrations/0001_initial.py b/dev/trydjango/src/products/migrations/0001_initial.py new file mode 100644 index 0000000000..981242388c --- /dev/null +++ b/dev/trydjango/src/products/migrations/0001_initial.py @@ -0,0 +1,23 @@ +# Generated by Django 2.1.7 on 2025-02-18 06:24 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Product', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.TextField()), + ('description', models.TextField()), + ('price', models.TextField()), + ], + ), + ] diff --git a/dev/trydjango/src/products/migrations/0002_product_summary.py b/dev/trydjango/src/products/migrations/0002_product_summary.py new file mode 100644 index 0000000000..22d7c43198 --- /dev/null +++ b/dev/trydjango/src/products/migrations/0002_product_summary.py @@ -0,0 +1,18 @@ +# Generated by Django 2.1.7 on 2025-02-18 06:29 + +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/dev/trydjango/src/products/migrations/0003_auto_20250218_0712.py b/dev/trydjango/src/products/migrations/0003_auto_20250218_0712.py new file mode 100644 index 0000000000..1b5e1a1f5d --- /dev/null +++ b/dev/trydjango/src/products/migrations/0003_auto_20250218_0712.py @@ -0,0 +1,28 @@ +# Generated by Django 2.1.7 on 2025-02-18 07:12 + +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='title', + field=models.CharField(max_length=120), + ), + ] diff --git a/dev/trydjango/src/products/migrations/0004_product_featured.py b/dev/trydjango/src/products/migrations/0004_product_featured.py new file mode 100644 index 0000000000..a0921d4bb5 --- /dev/null +++ b/dev/trydjango/src/products/migrations/0004_product_featured.py @@ -0,0 +1,19 @@ +# Generated by Django 2.1.7 on 2025-02-18 07:27 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('products', '0003_auto_20250218_0712'), + ] + + operations = [ + migrations.AddField( + model_name='product', + name='featured', + field=models.BooleanField(default=True), + preserve_default=False, + ), + ] diff --git a/dev/trydjango/src/products/migrations/__init__.py b/dev/trydjango/src/products/migrations/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/dev/trydjango/src/products/migrations/__pycache__/0001_initial.cpython-38.pyc b/dev/trydjango/src/products/migrations/__pycache__/0001_initial.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..c93148cbf1edb984fa1b908ac63eb438290dfa0a GIT binary patch literal 678 zcmYjPO>fjN5Vaj=vq`oR2gCvHpuIH99aTlFijZi9MB$K&m1d@qxB0@(wk%h;_CJ&( zcYckpocId}0pn~-JC;Xp?6K#~v)}FPB#i9p$@gkcF!sX-cTG~TPt!go2Ml=48lLk; zT_HeE<3OQhE2m@+xlSc5&9r*5joQ%bo+DbiwHBjK4+AJ#?flPQXH zs|Tv(W`I4mfNiPK8hRJz(ibDSL$9I<{7U?sI3M@|EY91Rky^Z%K*=_!E9h$$*d`}ek+g7ZeK53EEZ4IHM`w@WBj+6(6kT8 zO@$OvN-o5Gp7`-w{E>ghoFmdU-rl_nCu1ig`Em1>-4;EfyWI5IR-8TGqxG%d3;qF$ CnY+pW literal 0 HcmV?d00001 diff --git a/dev/trydjango/src/products/migrations/__pycache__/0002_product_summary.cpython-38.pyc b/dev/trydjango/src/products/migrations/__pycache__/0002_product_summary.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a4616af32fc828ebcd60550405e4d7763fa11309 GIT binary patch literal 595 zcmYjO!EV$r5Vd1xla01g5A@CnH4gAds)cl_&+s4=j)WQ7+3Pmvzm`RAZxi>t>w>Y;EnS$2KEyOvgSahpgnl z$_V(1mjdNF_6=~hPC!C@&0%&eh)E%#HmRGxzpqct(!pq$>e0Hza=Cn=n!XvEs&&aO z?h-q7U1c`k7vrbKKBd3by3M&u057Vk9dkhw`zcjlb?9X9@kN6zoaS?vst{MoWlB-r z)FRy%N`0BC*5`TzIA9Oh*9}?|ktCPC0eI_c7~$dk3@^ukU8V=zt>+grPlyff=B)Up z&1XAQHQM52UG*z{f}Jh^zZRp}K!_C9)WyBz;$hJRiGQhfgxX0y8aBqiq+hn(Czp!o uPR5c)^kuj5F0iM$bn|WXBlsAm4>JeyVZQC{fU3Ck)pifBy)^6P?u-AXl%Zz; literal 0 HcmV?d00001 diff --git a/dev/trydjango/src/products/migrations/__pycache__/0003_auto_20250218_0712.cpython-38.pyc b/dev/trydjango/src/products/migrations/__pycache__/0003_auto_20250218_0712.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..353132ed0d586298ff65b8a8e527c8cf630ab155 GIT binary patch literal 769 zcmZWnO>fjN5OuzGlk9Hkfh(L4D3>M;Lgj#}B35vs7mAP~BrDCBG+XBbJ1M(oxb6?( z&Y!_o4rqS>7o-Zt$*x+&SRVO3&t%?=^L94#3EI#2TmIc7v7TRubw1Po3} zBQZ)dF%9yHfC<(Y0v0nC)@LiRz29U%ABR3L@*$YP(V57wtY+TOTgwcA(kCAu51rPjx_zChJOkuV*baZYdKJ1~a zJIZ^#(}UvNM%2({txWDlQ54fHq_Qi^RIJo^OQ;DjnTev&eVk#UbI#N1QrT62x~%e_^OlL1T8^+Z z;hnK%+haAI4_XG~y|_q+K;_pB+rHXYBJN>Y?|#1vKh@$=Hd=W&U!+xD&skZAz^=kp zte|H?DY9@k+3@E5L!9wrns#kX<0yU-#fML6baWUWG%KP1u@P?h0G(@@e{9D#OkC6J t|4;t4{j1M74Q%BNMGxS-@3-%obKb7mHTX%+_4^o)C1bL{sJ;&)9?TQ literal 0 HcmV?d00001 diff --git a/dev/trydjango/src/products/migrations/__pycache__/0004_product_featured.cpython-38.pyc b/dev/trydjango/src/products/migrations/__pycache__/0004_product_featured.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..159447655334c9d43151f69d754aefd0110a6d17 GIT binary patch literal 621 zcmYjOy>8nu5GEzcmW2ce3Z!|10$wb|{T+%TErN7vmNttPg4LZ3yOOAoQi9Cwng?m; zJ`LAQeTAYxdZcY6NALrWcjR~X-NpWX#>g&T{a*g!jNN(Xu?cccXxnE5z<}4R;U#aP zGUDtbg9zdu3}WQ#_NNNzcdV0Y%apq@;6e>`e>N3Vv#(ROszE0LCW{r;;0`*27R?pP zZT30wr!r(p=`tzlg`kf-bc!=^*+sh(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o6v5zdXMvySN}R zIki~dB`Yy6J>MlYH(x&`wM@UHs4@jCqF-E;tY1)+pHiA!QmmhwnO>Awl9``ZtREkr cnU`4-AFo$Xd5gm)7pNd7)edCCXCP((08h0k3;+NC literal 0 HcmV?d00001 diff --git a/dev/trydjango/src/products/models.py b/dev/trydjango/src/products/models.py new file mode 100644 index 0000000000..eece0421c0 --- /dev/null +++ b/dev/trydjango/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) #max_length = required + description = models.TextField(blank=True, null=True) + price = models.DecimalField(decimal_places=2, max_digits=10000) + summary = models.TextField(default='this is cool') + featured = models.BooleanField() #null=True, default=True \ No newline at end of file diff --git a/dev/trydjango/src/products/tests.py b/dev/trydjango/src/products/tests.py new file mode 100644 index 0000000000..7ce503c2dd --- /dev/null +++ b/dev/trydjango/src/products/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/dev/trydjango/src/products/views.py b/dev/trydjango/src/products/views.py new file mode 100644 index 0000000000..91ea44a218 --- /dev/null +++ b/dev/trydjango/src/products/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/dev/trydjango/src/trydjango/__init__.py b/dev/trydjango/src/trydjango/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/dev/trydjango/src/trydjango/__pycache__/__init__.cpython-38.pyc b/dev/trydjango/src/trydjango/__pycache__/__init__.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..996202dc2593be76521c21d514f01cc5b89bc665 GIT binary patch literal 153 zcmWIL<>g`kf^3E@=^*+sh(HF6K#l_t7qb9~6oz01O-8?!3`HPe1o6vGzdXMvySN}R zIki~dB`Yy6J>MlYH(x&`wM@UHs4@jCqF-E;jKqtN&&0{ literal 0 HcmV?d00001 diff --git a/dev/trydjango/src/trydjango/__pycache__/settings.cpython-38.pyc b/dev/trydjango/src/trydjango/__pycache__/settings.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..938632e159d0953657037e64a697a0b5bd0b10fe GIT binary patch literal 2316 zcmb7F+j7%J7`7F~c1#=s;Z&flQd&YtBay-Y?G%czMeyK5CXz|33p9%Vjj}-pqg|0$ z_k9a4%4P5S7<~fW_Noui&a}gn{*oQX<1o|Ivevu*dB6Ssb*EA(=kW96(l1Ulo6G%{ zF2+A4Ts*>;{fYzR%pBxFaPwxK@n;EFj1SK;F< z+i6mOPu>df=^KIO&3TYu5iKS7EE}(7}IG9KPrAy#Pz*MG*Ad z@(o+g=W^xRp6xq<#0clqcbK#jgc1+?Fc9~`V2^aUTrRH@pM*9iAZ_=hrGa|Y29Np@ z<95i0mP=B^Fpe|~`<1*V-$U;w7}X0xB2ga`cs8ejFX5N(QcOu*@+DS4%DbHR*f)v- zL6^yc9ETNj15Y8of&mpC^k|nUhb1e6@O+m@JCW;3E@fN_c8<1W`+$iE4W-w%8xi(@ za)o4PEYa^sf?O-UOV|8cch<<_ed6DE(cixFb>xQ2*8>vwA3bpQR&K%m1LxWS9IQTg z(GTt)tSm0xbXH;`J~!Bt+zosl(rr1zFJ73GMtnEEG9gS|h|hVyM_7DuLdghYi0E;J zhYH(4kIR!D9M7PeBG1ecVhmB2vv_rA&4_ToEj+X?mKB67zA+i(xQz^CJ96TiC$J33D{K-TuMBNRWK9wM zK;#tZ`1XYH2*nRL9O{@iD^`xY3Y*^W>*xoSe?Uo*2J_2l?IaIcL zJ;XUX#H0vh$BtY+VmE9b;m2ONl#|uFmz z^klBy(hU@$0FPf!%FTMM*3h=pO)Z(-Y_|=ov)QP&TThZ1Lu+m{R72B~`7M3Dp4vC+ zRW)TwBJKs$PiAVWp{B|8LKq(!NNW!Km4w+6Gu+O1YnNM(kJJ25a*HLd37Tqq%Rvf=NC3KHcdB7p6v)UtN1 z5id}HyjDi!Ran>^Uk(3myn4~cbsFdaS&%qQ&)@PlqiS=AwPPig+Ij8 uqg5*ZODv0GCJ{#Rcfxz&o%mjy7mKNE_8**Agd9r6W84W`Ji951kdS66mY?(dz3=<{e0_Wzc`$ChZ{^Rx^S;|)I7Seh!Ka_WM7@PaeHzq0 z4;F!M*Q0vG!$s(OETka|Hsj5~m!R|)hjjeGOAd$vP@}eVLqsXj_4~KzT#8jywu+ca ziYWTHX6U9>bwi9{O6VI@SK1&YTf?+HpplX2u44B(MVC?`E)_$SSV_el1ZrwVG((!P zEJ85W#xy#^n94$@yTXl<8&;UKkQ_6CPty}@WK$Iy+hh#oHI80?A{?-E7G1WYui=f^haC zw(B^F&TFFe(%4C6YR$_H^C=mSg`wHa0&cI=3LRi zN%RAn)l2+tOen7eEJEw}=K~kwcgdtX%ya0EJYPKSDS;BBs-^8$uR9v>RQ3sUp{@+; zLQA|m8eHaAPd$SFZu*tsd#P@9Lkgzxg=_f>#wDig4*z`wSgT?XS;Vy2c9Z8^(za$V ReSp&wn8GJhe>$4}{sZDJBJcnJ literal 0 HcmV?d00001 diff --git a/dev/trydjango/src/trydjango/__pycache__/wsgi.cpython-38.pyc b/dev/trydjango/src/trydjango/__pycache__/wsgi.cpython-38.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5b156e0fe68efca054e92fa04f2f7220b9455f78 GIT binary patch literal 560 zcmYjP!EO^V5cN7~6BddPLY#e#1Z&_}Ap}xNlnT;AT2;zrW7d<6Q?I?U-GubYu|Lrs zx$`sl+Eagl6SIk0WhBq&c{KChjD2=+kP@^D@~6B`2)S#(uC)<-#^c|ilVn0X*~~f?+*&S#DJ`p= zT|g1CG#v&8KWpp3voHs?EfHFa9~zkOOt8wzOAT)|EJ3rSaB7n>q5{dLQ&HDi6(T5W zrc>_?nz9S>P?jL^{4Nmg$(dp@MG#KaKPx@!yj;>xl z&YyV*L7CF`Isid3-!W~rPtF~vd&GjXXye7eK=o4DpN zH}2mdUs-qIYf*sb{msJrP&IQb`J)8xU9p22uB=|i?#J!AKjDuczKgE?q)VUC=k!0< CO|Ogq literal 0 HcmV?d00001 diff --git a/dev/trydjango/src/trydjango/settings.py b/dev/trydjango/src/trydjango/settings.py new file mode 100644 index 0000000000..c7779ab75e --- /dev/null +++ b/dev/trydjango/src/trydjango/settings.py @@ -0,0 +1,127 @@ +""" +Django settings for trydjango project. + +Generated by 'django-admin startproject' using Django 2.1.7. + +For more information on this file, see +https://docs.djangoproject.com/en/2.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/2.1/ref/settings/ +""" + +import os + +# Build paths inside the project like this: os.path.join(BASE_DIR, ...) +BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +# /workspaces/DjangoDemo/dev/trydjango/src + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/2.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'i1n041e!8en(^yb49ulr)&oezy@=lj+0dw=g#xdx-=^yo8x+!!*g+z' + +# 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', + + # Third Party + + # Own + '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/2.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), + } +} + + +# Password validation +# https://docs.djangoproject.com/en/2.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/2.1/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/2.1/howto/static-files/ + +STATIC_URL = '/static/' diff --git a/dev/trydjango/src/trydjango/urls.py b/dev/trydjango/src/trydjango/urls.py new file mode 100644 index 0000000000..dad83c821d --- /dev/null +++ b/dev/trydjango/src/trydjango/urls.py @@ -0,0 +1,25 @@ +"""trydjango URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/2.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_view, name='home') + path('admin/', admin.site.urls), + +] diff --git a/dev/trydjango/src/trydjango/wsgi.py b/dev/trydjango/src/trydjango/wsgi.py new file mode 100644 index 0000000000..47a28f9ce2 --- /dev/null +++ b/dev/trydjango/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/2.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()