From 51e46ea2401927f0c0755d48b67e33b92d280d39 Mon Sep 17 00:00:00 2001 From: ms01732 <mansoor.saleem@stud.th-deg.de> Date: Tue, 4 Jun 2019 21:39:22 +0200 Subject: [PATCH] Comment section added --- accounts/__pycache__/__init__.cpython-37.pyc | Bin 152 -> 133 bytes accounts/__pycache__/admin.cpython-37.pyc | Bin 193 -> 174 bytes accounts/__pycache__/models.cpython-37.pyc | Bin 190 -> 171 bytes accounts/__pycache__/urls.cpython-37.pyc | Bin 419 -> 400 bytes accounts/__pycache__/views.cpython-37.pyc | Bin 1143 -> 1165 bytes .../__pycache__/__init__.cpython-37.pyc | Bin 163 -> 144 bytes accounts/templates/accounts/login.html | 4 - accounts/templates/accounts/signup.html | 6 +- accounts/urls.py | 2 +- accounts/views.py | 13 +- articles/__pycache__/__init__.cpython-37.pyc | Bin 152 -> 133 bytes articles/__pycache__/admin.cpython-37.pyc | Bin 761 -> 279 bytes articles/__pycache__/forms.cpython-37.pyc | Bin 602 -> 995 bytes articles/__pycache__/models.cpython-37.pyc | Bin 1614 -> 1402 bytes articles/__pycache__/urls.cpython-37.pyc | Bin 430 -> 411 bytes articles/__pycache__/views.cpython-37.pyc | Bin 1249 -> 1624 bytes articles/admin.py | 16 +- articles/forms.py | 13 +- articles/migrations/0001_initial.py | 4 +- articles/migrations/0002_article_thumb.py | 2 +- .../__pycache__/0001_initial.cpython-37.pyc | Bin 758 -> 739 bytes .../0002_article_thumb.cpython-37.pyc | Bin 606 -> 587 bytes .../__pycache__/__init__.cpython-37.pyc | Bin 163 -> 144 bytes articles/models.py | 36 +--- .../templates/articles/article_create.html | 13 ++ .../templates/articles/article_detail.html | 38 ++-- articles/templates/articles/article_list.html | 7 +- articles/urls.py | 12 +- articles/views.py | 49 ++--- assets/styles.css | 84 ++++++++ db.sqlite3 | Bin 151552 -> 159744 bytes manage.py | 2 +- templates/about.html | 81 +------- templates/base_layout.html | 190 +++--------------- 34 files changed, 218 insertions(+), 354 deletions(-) diff --git a/accounts/__pycache__/__init__.cpython-37.pyc b/accounts/__pycache__/__init__.cpython-37.pyc index eccf5e2a13550da4a41da1b441c8a99d7f5919c2..67e33fa41a04edd0b14429831cb595326765d126 100644 GIT binary patch delta 49 ycmbQi*viQ5#LLUY00h_8f1b!~A*JVP72{hOA5fH^m6}{)7?WFB0A)@r&;S5gK@Y$H delta 68 zcmZo=oWaQL#LLUY00eIH9!%u6&~<dSiU}=FEh>)jb@U7N_YYDCcJy&|^^I{!EzT~< WFNjIWO3X{o&r2*V$xNOYs{sIpH5GFJ diff --git a/accounts/__pycache__/admin.cpython-37.pyc b/accounts/__pycache__/admin.cpython-37.pyc index 0e09fdcfbfb405e59223c7bf8dfc7f6094d6aeaf..9d4fa6482548ae0cfa2ec0ff5afef9542041dda5 100644 GIT binary patch delta 49 ycmX@exQ>zAiI<m)0SK<G|2&a9MM~S%D#o`mKA<Q+D>b>qFebOM0Lq*=M->2V^AKbJ delta 68 zcmZ3-c#x6XiI<m)0SMgYJ($RyqHE`D6%$&VT2vh4>*yEk?;oTP?C9g_>Ko&dTAW>y WUl5a$m6(^FpO;u#l9@cQQxyQD2o@Ir diff --git a/accounts/__pycache__/models.cpython-37.pyc b/accounts/__pycache__/models.cpython-37.pyc index 7c6292b87d4061b4197fcfd887e7bff9ccf4bf19..7a15529d353a2dbd4a2255c8cfe4834cde317bf0 100644 GIT binary patch delta 49 ycmdnTxSEmMiI<m)0SK<G|2&a9K}yHfD#o`mKA<Q+D>b>qFebOM0Lq*=Lk$3IZ4g)h delta 68 zcmZ3@xQ~(BiI<m)0SMgYJ($Ryplk1J6%$&VT2vh4>*yEk?;oTP?C9g_>Ko&dTAW>y WUl5a$m6(^FpO;u#l9@cQRSf{4*A@!^ diff --git a/accounts/__pycache__/urls.cpython-37.pyc b/accounts/__pycache__/urls.cpython-37.pyc index df585f663b15326b7fe91976cb3835c605419798..bd3addbe7f63cbeef32b7fe04cf1adab60fbc674 100644 GIT binary patch delta 53 zcmZ3?Jb{_liI<m)0SFpTe~#hb$ZO3grR8cB<69XYP?VpQnp|QSlUrE;Wlk<-)B^y9 Cpb$O) delta 72 zcmbQhyqKBSiI<m)0SF>gp2P@l<h5qhwRN_N2`x@7Dvt4W^b7X)4^jwr^l^3djd4jW a&MwI>h)Kyx%uCPDODrwPOrD&?s0RSHjuprN diff --git a/accounts/__pycache__/views.cpython-37.pyc b/accounts/__pycache__/views.cpython-37.pyc index a57848d2696180fbae3aeb0b1f19844a87bfc3a6..d1fd2acbfcf7521a9ae1eda43fefef9ccc7e2f1f 100644 GIT binary patch delta 283 zcmXYsF-rqM5JvZ#-P>GFlPF38v9UB-*;u3$Yy?F(D?O0l9^yr#tXmk^!{Wd$)s{B7 z($YU+E0$huZDV2U9%PDnA2Sbz`3q;w_I|4sF<<=SH~A88?N{`74u;9m^x{O{W$C5a zO>U?6i|D=)KV{ywEMp2|(x(PKlcE`NSj>6J^qHq9SxzRf%u+#Mir3ay>O&*zG;b(g zqCm`yRHEiY8Wb#t2`y8Bk`~t}c+3WkV;%a715`qd%%}>)Bz-jQg|^Xj@3a+E{3<o> zhxYpG^&^O|jF3Xl2rCqkgzmZ_e_q}6+XuODLg=3R<Tp!QKhV9pbsYGbI~N=1`~$h0 BLID5( delta 232 zcmeC>{LaDW#LLUY00hrGAI5O9Zsc3ZsB7nJ6%$&VT2vh4>*yEk?;oTP?C9g_>Ko&d zTAW>yUl5a$m6(^FpO;u#l9@dDB4e;p0MLLMhAf5@#%!h{s}e>an<<5<m$8<yhH(M& zLWUxTNsOYp%*~9!40&uNjLi(Sj3w+f3@I!rtTl|8jLpo!44Q0yMI1n5G#PKPq$HLk zPF}&J#mF)FGLyz6W-~DXkP{iX7<m{um^gqm7ZV#}k;vo#<~BiDpiD6vRGx#eNObaZ R<{UN=pa75=$zsgN0{|`RHPQe8 diff --git a/accounts/migrations/__pycache__/__init__.cpython-37.pyc b/accounts/migrations/__pycache__/__init__.cpython-37.pyc index 31f20cd4434a2928855e203203d06d0cc077c818..c82e28bba6d986345c2f64f4f37578a7f5ad83d9 100644 GIT binary patch delta 49 ycmZ3?IDwJdiI<m)0SK<G|2&b~Ldw$BD#o`mKA<Q+D>b>qFebOM0Lq+LU<?3Ws}Jk| delta 68 zcmbQhxR{aKiI<m)0SMgYJ($RCq3h#p6%$&VT2vh4>*yEk?;oTP?C9g_>Ko&dTAW>y WUl5a$m6(^FpO;u#l9@a))))Ye5*42S diff --git a/accounts/templates/accounts/login.html b/accounts/templates/accounts/login.html index 64fe133..1a50d6e 100644 --- a/accounts/templates/accounts/login.html +++ b/accounts/templates/accounts/login.html @@ -12,7 +12,3 @@ </form> <p>Not got an account? <a href="{% url 'accounts:signup' %}">Sign Up</a></p> {% endblock %} - - - -#5 in the accounts url i want to use login url diff --git a/accounts/templates/accounts/signup.html b/accounts/templates/accounts/signup.html index 2a81b10..c4021c8 100644 --- a/accounts/templates/accounts/signup.html +++ b/accounts/templates/accounts/signup.html @@ -2,11 +2,9 @@ {% block content %} <h1>Signup</h1> - <form class="site-form" action="/accounts/signup/" method="post"> + <form class="site-form" action="{% url 'accounts:signup' %}" method="post"> {% csrf_token %} {{ form }} <input type="submit" value="Signup"> </form> -{% endblock %} - -#6 is the security csrf_token which server gets and knows that data is comming from your application +{% endblock %} \ No newline at end of file diff --git a/accounts/urls.py b/accounts/urls.py index 5ac0941..0fd1256 100644 --- a/accounts/urls.py +++ b/accounts/urls.py @@ -7,4 +7,4 @@ urlpatterns = [ url(r'^signup/$', views.signup_view, name="signup"), url(r'^login/$', views.login_view, name="login"), url(r'^logout/$', views.logout_view, name="logout"), -] +] \ No newline at end of file diff --git a/accounts/views.py b/accounts/views.py index 391aa97..710a334 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -21,7 +21,10 @@ def login_view(request): # log the user in user = form.get_user() login(request, user) - return redirect('articles:list') + if 'next' in request.POST: + return redirect(request.POST.get('next')) + else: + return redirect('articles:list') else: form = AuthenticationForm() return render(request, 'accounts/login.html', { 'form': form }) @@ -29,10 +32,4 @@ def login_view(request): def logout_view(request): if request.method == 'POST': logout(request) - return redirect('articles:list') - - - -#user is varialbe in 22 which is going to retrieve the info of the user trying to login - - #on 10 and 21 we are not logging in the users but redirecting them + return redirect('articles:list') \ No newline at end of file diff --git a/articles/__pycache__/__init__.cpython-37.pyc b/articles/__pycache__/__init__.cpython-37.pyc index 390612bd9f75cfa1447b1c5eb08623942c24509a..fc67c359c7e42816d3ff4bc432533ac075eafb80 100644 GIT binary patch delta 49 xcmbQi*viQ5#LLUY00c?>4<>S3Na?v+#rRgn2NdOJr6!jc#^hEOK$#N@Gyp;i4;cUe delta 68 zcmZo=oWaQL#LLUY00hrsuTSK*&~<dSiU}=FEh>)jb@U7N_YYDCcJy&|^^I{!EzT~< WFNjIWO3X{o&r2*V$xNOYs{sI+0u{*s diff --git a/articles/__pycache__/admin.cpython-37.pyc b/articles/__pycache__/admin.cpython-37.pyc index 98cfc9723b26a5696879ca6b9ea6d6512c01826e..1c5b9d369fbd53bba1fcdf3b3cbbf7c85cdaf1cc 100644 GIT binary patch delta 187 zcmey#I-N<~iI<m)0SNM*eU51Z(vLwL7+?l69DumkVxqddTq<K0>jJh^=7o%m3{W-; zh@HX`%%I6Su}7WRPm_IeHIqgnOL1mN>Mf3<)bz~alGLJ=3`LwkQ^3S8ZC9%p-^%!a zqWrAX<PyV}+{ywNGqI>7GdU-<I3_VAH#1MKpz;=nO>TZlX-=vgBghqOK!S%+fQg3@ E0On9HRR910 literal 761 zcmZuv&2H2%5VjNNXP4}%Y_A-+=F$g1sM@7eT-dF|ic1tJn2g!FI6v4)r5-rZ2PsG1 zg(vV8ap)^>Vw|K%m2l)Q;~D##na_T;Sj-8I{ny|5PfExyw|E!~jWtg50Rae5MJk$6 zO27kOd6l2}70VbUZwN35ZV3c}UIpL$EX03w7Ykp6-@PFoLWJ>XiqEDv6Ehcwcu&&V zJ!T;(wE>4p*7sNqNj)2FbSFzCY;@LCm8iSYZF?9V8f%>98G;}g1(JC{GatN+fe%d5 zEPw#%Lz_%Y8%K}KK_@%p4SC;PHahimgd8?1o4Ug^mKoI_QaX5dcswqOnpdJI?7S$d z272Y}q$s}hTuqTgNz)Y|O{@5gT^PZ2d0BjtLV>Zztrl(5_KJ4`Cg%^LpJLVl{+yn@ z$ln{GO}^di_7@lLp6@qr&(F8{YhgZjO`F3NuMbU)1<Nw$qb?>N<T`0@bcjp=PUDQ2 zGW-VLBgLGoYq#kL;jv<<l5dkq=20czvK}k4fvC7tHs)=sn`;5Pl<6l(pc4lR2TKS4 zni;K?^Bp6&ZN^<zOo#O@ooCCjof9XxmLIhX+Ypr%%4qlYv}?xBx6U(^GjxL&BRgSZ gEe<HQ&;#H965IIYcul8{*|>L}&?9dZEWMTg7buFiq5uE@ diff --git a/articles/__pycache__/forms.cpython-37.pyc b/articles/__pycache__/forms.cpython-37.pyc index f0f620fa03949dc7005e4b36bfabbeb459568c37..a3447729af49629112dd2e3320200e60570aa177 100644 GIT binary patch literal 995 zcmb7DJ&zMH5VhCdk9<K0&|E>kLW)F-5Xx~ns1hL|8Y|MW$@p@K*4e|}6uAx^f9C#@ zTdM1+sF>MJ?h-@+mi%@+mfy_0nSIymwHdC{FF&W>IAcHPuwN355pFj{00z8ZhAYk) z1R#pQ2qkJ;7Q#p+O{hXVGYE^w#46_O1A_?S?+jwiSILb~E%YSNLQiYwX+!%HOFMTM zfu-Ds7o|1s4l|)sWJ=J5O9LOD+G;s3w2#k9WAwVhTlv{(JEw>HCD0h*b|(m$DGp2p z7?MMPA%mMh2@n`g`ret<d8K!(M<n-Ezc?V#VkK2bL?A#eq>3O!qUd^XL^K@hD)(Wv ztT0tMD`D%UD>e&sU2e>5lEyyCvUP5Bmicy;VSSr|>~5BQ-Q-1cV<`n2BKWXYz(*HL zU4Xk~c0gAIzh0ido{qQKM_aD+ym~b?+pE2qH)6SIt>*9wv!KLceCCKd;Ssmb(3qss z_V8;T5j-X!_d}G%dP=?oA;RqfgoM}UBjNsC{m!n5@3GlO6x8<-#h@(q4b(zO;HZ9p zii_+1!Q)zQ9EEsZt}C31NgDlG52bAT1WyR=^*gAHf^~84w2}X>&2xO+A%>kcbe^Og zAHgbLFG@>p&mQ_}DJy@{+zu&uyPOU4O?5eJM&44dd}~bePb$@FTcZ721wMJxOwwBt Q(9s{=<z3$A-Cz*@23i!!&;S4c literal 602 zcmZuuJ5Iwu5Z(2z9TO7qDG>#2nj8QjM1Vj;5{Zb$vSb-%69VfPcI^V%a26!a!7a8$ z6uANwGq(6ij5N>lS-<%mw%bjH5<b7julRi<=Sw6S2dK7-01UWh8IL$;;DOLyCL+Pv zDFX@q69ZrI8@UjX55bsq8cY0#b-42<xykI3*IuJ%irJM`SCst{fyM!<-9k_-;=m#g zc{zB<>n*%UfIv>^+DAsEh5C==yV>nuBuYe*Xh49RN^H$Xn&5Hs4^4NViq!eVtkBBI z%N!n@w7Q&P=(@}<hn>KMNit6}l_aj2Bv}rnCcBj+_hqW<jG+dck4dFnFqtV0_Jx@> zj8^cmf3zE4SY>QH=ncoC(fQ7}ch>I@;$vlRi~KHzn{+<S=V^%>iqm>eHm=s!y~CcU z%>d~vRSLP}W&@33M;bbzStV!@Q23{CZLL$xM<BHxLdYwh#tZ7whQcnWMzHlfD+8M6 X1W#B!{*Tp#d-X>4>Bd!aE#4BJYO;vO diff --git a/articles/__pycache__/models.cpython-37.pyc b/articles/__pycache__/models.cpython-37.pyc index 25e683bfb970a20ec7f5ec27d9d7fa5ca36e15a7..82c561f6a0c04919808651aa65eb1f830149cd20 100644 GIT binary patch delta 792 zcmZuvF>ljA6uvwAY$tJ&rWBMQ6)J>~BB4lZfT{{Ls+d|T2#XcTGPx_nvg7FN453sR z(zOz)CFU~lKllZ(-^x@b2BuED=ad2xw*0;Cz4Lv~{@#6YFUqy;YPC$@nnyqTpNvJV z`SJ;5f(ROsn0k~VXAz4H&!FTf5r#02i7+J%&AH)msBmFH#k#Cm!hS*8&N+&<skY)o z$S7Up-%JN8`DgQ9enuOcRY)%G?>z4BPW^qAgmREQ=*QFXZy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O6+!Xr-B9<IMb<jU^%`&_{DoGyD(ci^j1t_5#r zyds+~m#XA9eX#c?*4s6H6lHO$qR6zO2$`=E)`KYeeHABlM04h*Ik<@R@mwXOgUTKy zt660mr+{jjWA&=67x12@a~PLu4B9q}2&QTMlE$;z6T0QaDm^!?<6NuxEc;bmYHkJN z{r2>1d^8w`4P5L+uJty&`XLK0%N@Z7)y%AiQSdTf2GYkbkXv%c^6e^m4{<L2J};j@ z+(ldg?nQ$^C;QrA#1}sI8PEpiH!a{^BaTjkuL7KWYC`W)i`qcCO96E-Z_^fv)ivHA zPg9kZYX;Bw)7mO}wr;~w@o56B65I?`Wmvz19|h&}0DkRbKF0h3$y}26ppbkmBH(f( z-vV)BP^{q?z2L{orOsa}LW$y+;QM2w=x^|@uP_R}eIXn2YI~D+|Mvg)ApK+)IV&{F zCpO{Y>|wk|@pg+%8w`67^e*E1GZvq-;4|v4S#XI>dvr984v&rxo}G-1v&_+1k2v@( zi^sgeRcSm=^p~uAQ?2+~P4Fbo6BTDQnS9oor;nkuhbZq~aL|{#6-<E)EZ@-_8}^!} zSvP&3&g;GiHa5NiNujxc&Et)0nrEe+pZ6K#e*IOb33pHVb6g#(dhZ>itF)>H_J63` Q@khSzf=S>^0()oce`649r2qf` diff --git a/articles/__pycache__/urls.cpython-37.pyc b/articles/__pycache__/urls.cpython-37.pyc index f6bf1db572e69c31b6d3b5a3f2f8b346fbe7f8cc..f9de492cd4f36b108d4dd0804a927af6dc097907 100644 GIT binary patch delta 54 zcmZ3-Je!%%iI<m)0SL+>zr;u}Zsc=il+tpwit(+C4=BpdN=+^?jLEGmfHEgHFzNvS Df0GaU delta 73 zcmbQuypEaAiI<m)0SGLXJ&oaK+Q{e1sB7zN6%$&VT2vh4>*yEk?;oTP?C9g_>Ko&d bTAW>yUl5a$m6(^FpO;u#l9@a?mr)M@*@+fd diff --git a/articles/__pycache__/views.cpython-37.pyc b/articles/__pycache__/views.cpython-37.pyc index 53c38113ae4f1f0ee6fe612ebc942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/admin.py index 93e0da2..dfb4a9c 100644 --- a/articles/admin.py +++ b/articles/admin.py @@ -1,17 +1,5 @@ - from django.contrib import admin from .models import Article, Comment -class ArticleAdmin(admin.ModelAdmin): - list_display = ('title', 'author') - search_fields = ('title', 'content') - prepopulated_fields = {'slug': ('title',)} - -admin.site.register(Article, ArticleAdmin) - -class CommentAdmin(admin.ModelAdmin): - list_display = ('user', 'email', 'approved') - -admin.site.register(Comment, CommentAdmin) - -# Register your models here. +admin.site.register(Article) +admin.site.register(Comment) diff --git a/articles/forms.py b/articles/forms.py index babd237..b172bc2 100644 --- a/articles/forms.py +++ b/articles/forms.py @@ -1,9 +1,14 @@ from django import forms -from .models import Article - +from . import models +from .models import Article, Comment +from django.contrib.auth.models import User class CreateArticle(forms.ModelForm): class Meta: - model = Article - fields = ['title', 'body', 'slug', 'thumb'] + model = models.Article + fields = ['title', 'body', 'slug', 'thumb',] +class CommentForm(forms.ModelForm): + class Meta: + model = Comment + fields = ('content',) \ No newline at end of file diff --git a/articles/migrations/0001_initial.py b/articles/migrations/0001_initial.py index 5e2c09b..f00b5f1 100644 --- a/articles/migrations/0001_initial.py +++ b/articles/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 2.2.1 on 2019-05-12 11:25 +# Generated by Django 2.2 on 2019-05-19 12:29 from django.db import migrations, models @@ -15,7 +15,7 @@ class Migration(migrations.Migration): name='Article', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), - ('title', models.CharField(max_length=30)), + ('title', models.CharField(max_length=100)), ('slug', models.SlugField()), ('body', models.TextField()), ('date', models.DateTimeField(auto_now_add=True)), diff --git a/articles/migrations/0002_article_thumb.py b/articles/migrations/0002_article_thumb.py index ceb57c2..fab11d0 100644 --- a/articles/migrations/0002_article_thumb.py +++ b/articles/migrations/0002_article_thumb.py @@ -1,4 +1,4 @@ -# Generated by Django 2.2.1 on 2019-05-18 23:16 +# Generated by Django 2.2 on 2019-06-02 10:59 from django.db import migrations, models diff --git a/articles/migrations/__pycache__/0001_initial.cpython-37.pyc b/articles/migrations/__pycache__/0001_initial.cpython-37.pyc index 5189c1b9377bcbc11b8c9fe6727a027910a5f9f7..0638003fad343903efe47b814392b7d25180e4b1 100644 GIT binary patch delta 59 zcmeyy`k0m1iI<m)0SKIZ9>&bw$m_t!m@?Uq@r{(Nt5u9|Wqd$UepYI7iD67`WdW2q IIi0B=01Z<UMgRZ+ delta 78 zcmaFN`i+&>iI<m)0SJ~c-H4gDk=KEdQEsvy;~U)oXRDad;?$zz7+*)fV1NH0g<wY? gS6AN{m(=3ylKg_0l&r+O^!&WU(vr;N$stVr0GMtWcmMzZ diff --git a/articles/migrations/__pycache__/0002_article_thumb.cpython-37.pyc b/articles/migrations/__pycache__/0002_article_thumb.cpython-37.pyc index 8bfce0719b792380e7cccf240825f94ef5743c06..6d02452dd51deefd477e390a2c10ecc86802b8ae 100644 GIT binary patch delta 53 zcmcb|a+-zLiI<m)0SE-we2!VUk#{<yl(VZ<jBjOpKv8~HYI2ETOm1ZXlsWk#V=n-% CsuA%3 delta 72 zcmX@ja*u`AiI<m)0SGK6J&0Mok#{<yZkV%GOlWaxQE`l~qhGMUe~?13qmQerZ;VT7 aadt_5K}<?kVqSWFUSerUX7c2HjJ*INjTlq_ diff --git a/articles/migrations/__pycache__/__init__.cpython-37.pyc b/articles/migrations/__pycache__/__init__.cpython-37.pyc index c12a98dd9c8997a74c75f58a56bf28beedf023f3..f66341432c1c53036d9697a7aa75e092dd59ddac 100644 GIT binary patch delta 49 ycmZ3?IDwJdiI<m)0SJ=%A57%7kg{~Oit(+C4=BpdN=+^?jLEGmfHEf*7y|%Dbq_@V delta 68 zcmbQhxR{aKiI<m)0SKPOUZ2Qqq3h#p6%$&VT2vh4>*yEk?;oTP?C9g_>Ko&dTAW>y WUl5a$m6(^FpO;u#l9@a))))Yw-xc)$ diff --git a/articles/models.py b/articles/models.py index 15a1df6..b8cee1c 100644 --- a/articles/models.py +++ b/articles/models.py @@ -1,6 +1,4 @@ from django.db import models -from django.utils import timezone - from django.contrib.auth.models import User # Create your models here. @@ -18,35 +16,13 @@ class Article(models.Model): def snippet(self): return self.body[:50] + '...' -class Comment(models.Model): - post = models.ForeignKey(Article, on_delete=models.SET_DEFAULT, default=1, related_name='comments') - user = models.CharField(max_length=250) - email = models.TextField() - created = models.DateTimeField(auto_now_add=True) - approved = models.BooleanField(default=False) - def approved(self): - self.approved = True - self.save() +class Comment(models.Model): + article = models.ForeignKey(Article, on_delete=models.PROTECT) + user = models.ForeignKey(User, on_delete=models.PROTECT) + content = models.TextField(max_length=150) + timestamp = models.DateTimeField(auto_now_add=True) def __str__(self): - return self.user - - - - - - -#add in thumbnail later -#add in author later - -#python manage.py makemigrations -#python manage.py makemigrations -#use the upper two commands whenever you make changes in the model -#whenever we make channges to the models when need to migrate kit -#11 theres alway error when you migrate so the fix is simply to add "on_delete=models.PROTECT" - + return '{}.{}'.format(self.article.title, str(self.user.username)) -#we create a snippet which is a model whose function is to cut the number of words to let say 100 -#to add ... at the end -#9 blank = true beacuse the if a doesnt want to upload anythingits ok diff --git a/articles/templates/articles/article_create.html b/articles/templates/articles/article_create.html index 8ed3ec8..f2d84ad 100644 --- a/articles/templates/articles/article_create.html +++ b/articles/templates/articles/article_create.html @@ -9,4 +9,17 @@ <input type="submit" value="Create"> </form> </div> + <script src="/static/slugify.js"></script> {% endblock %} + + +<hr> +<div class="main-comment-section"> + {{ comments.count}} Comment{{ comments|pluralize }} + {% for comment in comments %} + <blockquote class="blockquote"> + <p class="mb-0">{{ comment.content }}</p> + <footer class="blockquote-footer">by <cite title="Source Title">{{ comment.user|capfirst}}</cite></footer> +</blockquote> + {% endfor %} +</div> \ No newline at end of file diff --git a/articles/templates/articles/article_detail.html b/articles/templates/articles/article_detail.html index 032e680..c2d223b 100644 --- a/articles/templates/articles/article_detail.html +++ b/articles/templates/articles/article_detail.html @@ -1,32 +1,34 @@ {% extends 'base_layout.html' %} -{% block content%} -<body> - <div class="article-detail"> - <div class="article"> +{% block content %} +<div class="article-detail"> + <div class="article"> <img src="{{ article.thumb.url }}" /> <h2>{{ article.title }}</h2> <p>{{ article.body }}</p> <p>{{ article.date }}</p> - </div> </div> +</div> - <hr> +<br><br> +<hr> - <h1>Leave a Comment</h1> - <p>Total No of Comments {{post.comments.count}}</p> - <a href="{% url 'articles:add_comment' slug=post.slug}">Leave A Comment</a> - {% for comment in post.comments.all %} - <p>{{comment.created}}</p> - <p>{{comment.user}}</p> - <p>{{comment.body}}</p> - {% empty %} - <p> There is no comment </p> - {% endfor %} - +<form method="article"> + {% csrf_token %} + {{ comment_form.as_p }} + <input type="submit" value = "submit" class="btn btn-outline-success"> +</form> +<div class="main-comment-section"> + {{ comments.count }} Comment{{ comments|pluralize }} + {% for comment in comments %} + <blockquote class="blockquote"> + <p class="mb-0">{{ comments.content }}</p> + <footer class="blockquote-footer">by <cite title="Source Title">{{ comment.user|capfirst }}</cite></footer> + </blockquote> + {% endfor %} +</div> -<body/> {% endblock %} \ No newline at end of file diff --git a/articles/templates/articles/article_list.html b/articles/templates/articles/article_list.html index edf6c50..ec167c1 100644 --- a/articles/templates/articles/article_list.html +++ b/articles/templates/articles/article_list.html @@ -1,5 +1,4 @@ {% extends 'base_layout.html' %} -< !-- this file extends from base layout template --> {% block content%} <h1>Articles List</h1> @@ -9,10 +8,8 @@ <h2><a href="{% url 'articles:detail' slug=article.slug %}">{{ article.title }}</a></h2> <p>{{ article.snippet }}</p> <p>{{ article.date }}</p> + <p class="author">added by {{ article.author.username }}</p> </div> {% endfor %} </div> -{% endblock %} - -< !-- extending a base template, a base template has all of the stuff eg header footer etc all goes in to the base template --> -< !-- so that is how we extend template ie you dont have to add header and footer etc which are saved in base template --> +{% endblock %} \ No newline at end of file diff --git a/articles/urls.py b/articles/urls.py index 7067afc..5f9e10e 100644 --- a/articles/urls.py +++ b/articles/urls.py @@ -1,16 +1,10 @@ from django.conf.urls import url -from .import views +from . import views app_name = 'articles' urlpatterns = [ url(r'^$', views.article_list, name="list"), url(r'^create/$', views.article_create, name="create"), - - -] - -#?P<slug> this whole thing a name capturing group -#\w is anynumber or any alphabet then - then + for any length and then $ for end -#7 naming so that all may be different eg naming = list -#8 #here we get slug from views.py and use here + url(r'^(?P<slug>[\w-]+)/$', views.article_detail, name="detail"), +] \ No newline at end of file diff --git a/articles/views.py b/articles/views.py index 0ff1b6b..a4170ec 100644 --- a/articles/views.py +++ b/articles/views.py @@ -1,10 +1,9 @@ -from django.http import HttpResponse -from django.shortcuts import render, redirect -from .models import Article +from django.http import HttpResponse, HttpResponseRedirect +from django.shortcuts import render, get_object_or_404, redirect +from .models import Article, Comment from django.contrib.auth.decorators import login_required -from .import forms - - +from . import forms +from .forms import * def article_list(request): articles = Article.objects.all().order_by('date'); @@ -12,8 +11,25 @@ def article_list(request): def article_detail(request, slug): # return HttpResponse(slug) - article = Article.objects.get(slug=slug) - return render(request, 'articles/article_detail.html', { 'article': article }) + article = get_object_or_404(Article, slug=slug) + comments = Comment.objects.filter(article=article) + if request.method=="POST": + comment_form = CommentForm(request.POST or None) + if comment_form.is_valid(): + content = request.POST.get('content') + Comment.objects.create(article=article, user=request.user, content=content) + Comment.save() + return HttpResponseRedirect(article.get_absolute_url()) + else: + comment_form= CommentForm() + + + context = { + 'article' : article, + 'comments' : comments, + #'comment_form' : comment_form, + } + return render(request, 'articles/article_detail.html', context) @login_required(login_url="/accounts/login/") def article_create(request): @@ -27,19 +43,4 @@ def article_create(request): return redirect('articles:list') else: form = forms.CreateArticle() - return render(request, 'articles/article_create.html', { 'form': form }) - - - - - - -#this variable 'articles' saves all objects in Article and by .order by it sorts it by -#field date which is already an element in models.py under Article - - #third parameter in this render function is the data that we want to send to the view -#or template,inside curly brackets we write a Dictionary,"articles" is the property here,whereas the articles on the right is articles on the 7th line, -#this Dictionary will be sended to the template -#so when we render line 9 we display at the output the data -#we cature that slug vairable and use it in url.py url of slug - # return HttpResponse(slug) + return render(request, 'articles/article_create.html', { 'form': form }) \ No newline at end of file diff --git a/assets/styles.css b/assets/styles.css index 0993bcb..99e6348 100644 --- a/assets/styles.css +++ b/assets/styles.css @@ -18,3 +18,87 @@ a, a:hover, a:visited{ color: #fff; text-decoration: none; } + +.wrapper{ + max-width: 960px; + margin: 0 auto; +} + +div.wrapper > h1{ + text-align: center; + margin: 100px auto; + font-size: 2.4em +} + +header{ + display: grid; + grid-template-columns: 1fr 1fr; + padding: 20px 0; +} + +nav{ + justify-self: end; +} + +nav li{ + display: inline-block; + list-style-type: none; + margin-left: 20px; +} + +nav button{ + background: none; + color: #fff; + cursor: pointer; + border: 0; + font-size: 16px; +} + +.articles{ + display: grid; + grid-template-columns: 1fr 1fr 1fr; + grid-gap: 30px; +} + +.article{ + padding: 10px; + border: 1px solid #00dba0; + position: relative; + padding-bottom: 40px; +} + +.article h2{ + font-size: 1.2em; +} + +.article .author{ + padding: 10px; + background: #00dba0; + position: absolute; + right: 0; + bottom: 0; + margin: 0; + color: #0f121f; +} + +.article-detail .article{ + padding: 0; +} + +.article-detail .article img{ + max-width: 100%; +} + +.article-detail .article h2{ + text-align: center; + margin: 20px auto; + font-size: 2em +} + +.article-detail .article h3{ + text-align: center; +} + +.article-detail .article p{ + margin: 10px 20px +} \ No newline at end of file diff --git a/db.sqlite3 b/db.sqlite3 index 358f7aaeb9e62fb50c5b9c721b2c6dbeec05cf7c..f01b350e969d312554a2f1bed08c16683f19353b 100644 GIT binary patch delta 9688 zcmd5?Yit`=cAnvoq9~cVN@QDp$sS8q96KgGZ_dz(9m<w%*(T)&WtmE|>WCbYBMyfY zXGn<*0$R>y+wG?NDBBW9vfXXb7AVj^je&ZDU2HeoE()YblcH^a1Vx)oe`FU0Hrec> z$Zmf0+@T&6CD+{`$<~icaqd0me)pVn&uet^>%N<B`M$jOzS{&r9A5cP!e{0y$9VGg zU;XCSP&e&|@4I{-G`#%}`hL{&Vo$Y4@qKVR(*KgLesY(G7&;MAOSYagG>c)F(5zav z3$q-<DvZSNvkWIN_)CD10t`<x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aD zC+=a*sYB7Zmo=vjMdx1D9MC_M|DUqvO#5)sIT1aLlP`&r?@kgfsU<b5WMSAzU#$x| zILO1j8hjU77vVUzx**5L@^f=Ij|Gz6py%w_Q$S3Iju<))NZuq))(3L=rd1}#p@dn^ zi5=RlD_xEnW#O#F$#6PnR~IMqOU$)dOu9YM7WAAtbp}YgH2`v}R=2f1^&qb+WJ-Gi zi=b}YsZH+J?Qm9R;oDJ`r#OmPT}dyBJe9#@{c$4bIn#S4dWyiMM8nD3z0Sj*QihTv zcZdBz@#W%iD#FrG?l@J;D9|Ul1aYk(&{sX^t5AeqLW4_0yJzxz6s`t8;l`u+mrt}E mf5`nt1O8{g_DzWh-}N$WxVjPO$8go;9@qj<iM&Lp?SBE(xRfsd diff --git a/manage.py b/manage.py index 65c0735..6bb3761 100644 --- a/manage.py +++ b/manage.py @@ -5,7 +5,7 @@ import sys def main(): - os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djangonautic.settings') + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings') try: from django.core.management import execute_from_command_line except ImportError as exc: diff --git a/templates/about.html b/templates/about.html index 1b0ec71..c1131b8 100644 --- a/templates/about.html +++ b/templates/about.html @@ -1,72 +1,11 @@ <!DOCTYPE html> -<html lang="en" dir="ltr"> - <head> - <meta charset="utf-8"> - <meta name="viewport" content="width-device-width"> - <meta name="description" content="Articles and Published Blogs"> - <meta name="keywords" content="web design, fitness , meditation , professional, others"> - <meta name="author" content="Saif Ali"> - <title>Blogs| About</title> - <link rel="stylesheet" href="./css/style.css"> - </head> - <body> -<header> - <div class="container"> - <div id="branding"> - <h1><span class="highlight">Articles</span> and Blogs</h1> - </div> - <nav> - <ul> - <li ><a href="index.html">Home</a></li> - <li class="current"><a href="About.html">About</a></li> - <li><a href="Services.html">Services</a></li - <li><a href="login.html">Login</a></li> - </ul> - </nav> - </div> -</header> - - - <section id="newsletter"> - <div class="container"> - <h1>Subscribe to our Blogs</h1> - <form> - <input type="email" placeholder="Enter Username...."> - <button type="submit" class="button_1">Subscribe</button> - </form> - - </div> - - </section> - - <section id="main"> -<div class="container"> - <article id="main-col"> - <h1 class="page-title">About Us</h1> - <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec aliquet, enim tincidunt tristique lacinia, ex sapien ultrices nulla, nec rhoncus sem sapien ac risus. Sed dignissim est quis mi molestie mattis. Integer sollicitudin pellentesque lorem, id sollicitudin arcu dapibus vitae. Pellentesque sit amet dolor sed odio euismod ultrices vel in diam. Nullam euismod lectus non ex auctor pulvinar. Praesent a lorem pharetra, vestibulum lacus in, luctus diam. Mauris nibh odio, mollis in tincidunt ac, lobortis quis mi. Pellentesque vestibulum venenatis felis eu condimentum. Praesent enim nulla, eleifend sit amet mauris in, luctus aliquet dolor. Nullam vulputate mattis imperdiet. Vestibulum augue nisi, aliquet in lectus sit amet, tincidunt tempus diam. Vivamus ac magna nunc. Sed sit amet pellentesque risus. Mauris sodales in eros mattis egestas. -</p> -<p class="dark"> -Pellentesque est tortor, tempus quis erat sit amet, dictum interdum arcu. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Fusce fermentum interdum venenatis. Etiam ac nisi libero. Suspendisse est magna, vulputate eu efficitur sit amet, ullamcorper vitae ex. Donec hendrerit eros nunc, sed vulputate leo pellentesque sed. Vestibulum rutrum bibendum lacus sit amet dictum. Proin eget lorem vel felis feugiat accumsan. Nam et lobortis velit. -</p> - - - </article> - <aside id="sidebar"> -<div class="dark"> -<h3>What We Do</h3> - <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec aliquet, enim tincidunt tristique lacinia, ex sapien ultrices nulla, nec rhoncus . - </p> - </div> - </aside> - </div> - - </section> - -<footer> - <p>Tech-Science Blog, Copyright © 2019</p> -</footer> - - - - </body> -</html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>About</title> +</head> +<body> + <h1>About us</h1> + <p1>We are Django blog developers</p1> +</body> +</html> \ No newline at end of file diff --git a/templates/base_layout.html b/templates/base_layout.html index b9696e7..36cb023 100644 --- a/templates/base_layout.html +++ b/templates/base_layout.html @@ -1,160 +1,34 @@ {% load static from staticfiles %} <!DOCTYPE html> -<html lang="en"> -<title>W3.CSS Template</title> -<meta charset="UTF-8"> -<meta name="viewport" content="width=device-width, initial-scale=1"> -<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> -<link rel="stylesheet" href="https://www.w3schools.com/lib/w3-theme-black.css"> -<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto"> -<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css"> -<style> -html,body,h1,h2,h3,h4,h5,h6 {font-family: "Roboto", sans-serif;} -.w3-sidebar { - z-index: 3; - width: 250px; - top: 43px; - bottom: 0; - height: inherit; -} -</style> -<body> - -<!-- Navbar --> -<div class="w3-top"> - <div class="w3-bar w3-theme w3-top w3-left-align w3-large"> - <a class="w3-bar-item w3-button w3-right w3-hide-large w3-hover-white w3-large w3-theme-l1" href="javascript:void(0)" onclick="w3_open()"><i class="fa fa-bars"></i></a> - <a href="#" class="w3-bar-item w3-button w3-theme-l1">Home</a> - <a href="about/" class="w3-bar-item w3-button w3-hide-small w3-hover-white">About</a> - <a href="articles/" class="w3-bar-item w3-button w3-hide-small w3-hover-white">Articles</a> - <a href="#" class="w3-bar-item w3-button w3-hide-small w3-hover-white">News</a> - <a href="#" class="w3-bar-item w3-button w3-hide-small w3-hover-white">Contact</a> - <a href="#" class="w3-bar-item w3-button w3-hide-small w3-hide-medium w3-hover-white">Clients</a> - <a href="#" class="w3-bar-item w3-button w3-hide-small w3-hide-medium w3-hover-white">Partners</a> - <a href="/accounts/signup" class="w3-bar-item w3-button w3-hide-small w3-hide-medium w3-hover-white w3-right">Sign Up</a> - <a href="accounts/login/" class="w3-bar-item w3-button w3-hide-small w3-hide-medium w3-hover-white w3-right">Sign In</a> - <a href="logout/" class="w3-bar-item w3-button w3-hide-small w3-hide-medium w3-hover-white w3-right">logout</a> - </div> -</div> - -<!-- Sidebar --> -<!--<nav class="w3-sidebar w3-bar-block w3-collapse w3-large w3-theme-l5 w3-animate-left" id="mySidebar"> - <a href="javascript:void(0)" onclick="w3_close()" class="w3-right w3-xlarge w3-padding-large w3-hover-black w3-hide-large" title="Close Menu"> - <i class="fa fa-remove"></i> - </a> - <h4 class="w3-bar-item"><b>Menu</b></h4> - <a class="w3-bar-item w3-button w3-hover-black" href="#">Link</a> - <a class="w3-bar-item w3-button w3-hover-black" href="#">Link</a> - <a class="w3-bar-item w3-button w3-hover-black" href="#">Link</a> - <a class="w3-bar-item w3-button w3-hover-black" href="#">Link</a> -</nav> --> - - -<div class="wrapper"> - {% block content %} - {% endblock %} -</div> - -<!-- Overlay effect when opening sidebar on small screens --> -<div class="w3-overlay w3-hide-large" onclick="w3_close()" style="cursor:pointer" title="close side menu" id="myOverlay"></div> - -<!-- Main content: shift it to the right by 250 pixels when the sidebar is visible --> -<div class="w3-main" style="margin-left:250px"> - - <div class="w3-row w3-padding-64"> - <div class="w3-twothird w3-container"> - <h1 class="w3-text-teal">Heading</h1> - <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum - dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p> - </div> - <div class="w3-third w3-container"> - <p class="w3-border w3-padding-large w3-padding-32 w3-center">AD</p> - <p class="w3-border w3-padding-large w3-padding-64 w3-center">AD</p> - </div> - </div> - - <div class="w3-row"> - <div class="w3-twothird w3-container"> - <h1 class="w3-text-teal">Heading</h1> - <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum - dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p> - </div> - <div class="w3-third w3-container"> - <p class="w3-border w3-padding-large w3-padding-32 w3-center">AD</p> - <p class="w3-border w3-padding-large w3-padding-64 w3-center">AD</p> - </div> - </div> - - <div class="w3-row w3-padding-64"> - <div class="w3-twothird w3-container"> - <h1 class="w3-text-teal">Heading</h1> - <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Lorem ipsum - dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p> - </div> - <div class="w3-third w3-container"> - <p class="w3-border w3-padding-large w3-padding-32 w3-center">AD</p> - <p class="w3-border w3-padding-large w3-padding-64 w3-center">AD</p> - </div> - </div> - - <!-- Pagination --> - <div class="w3-center w3-padding-32"> - <div class="w3-bar"> - <a class="w3-button w3-black" href="#">1</a> - <a class="w3-button w3-hover-black" href="#">2</a> - <a class="w3-button w3-hover-black" href="#">3</a> - <a class="w3-button w3-hover-black" href="#">4</a> - <a class="w3-button w3-hover-black" href="#">5</a> - <a class="w3-button w3-hover-black" href="#">»</a> - </div> - </div> - - <footer id="myFooter"> - <div class="w3-container w3-theme-l2 w3-padding-32"> - <h4>Footer</h4> - </div> - - <div class="w3-container w3-theme-l1"> - <p>Powered by <a href="https://www.w3schools.com/w3css/default.asp" target="_blank">w3.css</a></p> - </div> - </footer> - -<!-- END MAIN --> -</div> - -<script> -// Get the Sidebar -var mySidebar = document.getElementById("mySidebar"); - -// Get the DIV with overlay effect -var overlayBg = document.getElementById("myOverlay"); - -// Toggle between showing and hiding the sidebar, and add overlay effect -function w3_open() { - if (mySidebar.style.display === 'block') { - mySidebar.style.display = 'none'; - overlayBg.style.display = "none"; - } else { - mySidebar.style.display = 'block'; - overlayBg.style.display = "block"; - } -} - -// Close the sidebar with the close button -function w3_close() { - mySidebar.style.display = "none"; - overlayBg.style.display = "none"; -} -</script> - -</body> -</html> - - - -<!-- this serves as a base and will appear in all and every template--> - -<!-- this base template will appeearr everywhere --> - -<!-- 1. by this we dont have to change the source attribute,and thats a better way to load style --> -<!-- 11. if there were two detail urls is in two different apps..django knows to look in articles url --> +<html> + <head> + <meta charset="utf-8"> + <title>Djangonauts</title> + <link rel="stylesheet" href="{% static 'styles.css' %}"> + </head> + <body> + <header class="wrapper"> + <h1><a href="{% url 'articles:list' %}"><img src="{% static 'logo.png' %}" alt="djangonautic" /></a></h1> + <nav> + <ul> + {% if user.is_authenticated %} + <li> + <form class="logout-link" action="{% url 'accounts:logout' %}" method="post"> + {% csrf_token %} + <button type="submit">Logout</button> + </form> + </li> + <li><a href="{% url 'articles:create' %}" class="highlight">New Article</a></li> + {% else %} + <li><a href="{% url 'accounts:login' %}">Login</a></li> + <li><a href="{% url 'accounts:signup' %}">Signup</a></li> + {% endif %} + </ul> + </nav> + </header> + <div class="wrapper"> + {% block content %} + {% endblock %} + </div> + </body> +</html> \ No newline at end of file -- GitLab