From fec65fe9c8315e775789953145b03a4df34a06c4 Mon Sep 17 00:00:00 2001 From: SEONGJOON KIM Date: Wed, 29 Jun 2022 13:14:18 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=ED=94=84=EB=A1=9C=ED=95=84=20=EC=A0=95?= =?UTF-8?q?=EB=B3=B4=20=EC=9E=85=EB=A0=A5=EA=B8=B0=EB=8A=A5=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- runningmate/db.sqlite3 | Bin 237568 -> 237568 bytes .../__pycache__/__init__.cpython-39.pyc | Bin 194 -> 159 bytes .../mateapp/__pycache__/admin.cpython-39.pyc | Bin 235 -> 200 bytes .../mateapp/__pycache__/apps.cpython-39.pyc | Bin 473 -> 438 bytes .../mateapp/__pycache__/models.cpython-39.pyc | Bin 1327 -> 1292 bytes .../mateapp/__pycache__/urls.cpython-39.pyc | Bin 340 -> 370 bytes .../mateapp/__pycache__/views.cpython-39.pyc | Bin 502 -> 1189 bytes runningmate/mateapp/forms.py | 74 ++++++++++++++++++ .../__pycache__/0001_initial.cpython-39.pyc | Bin 1361 -> 1326 bytes .../__pycache__/__init__.cpython-39.pyc | Bin 205 -> 170 bytes runningmate/mateapp/models.py | 30 +++++-- .../templates/mateapp/calendarDay.html | 8 ++ .../templates/mateapp/createDay_form.html | 12 +++ .../templates/mateapp/create_my_profile.html | 13 +++ runningmate/mateapp/urls.py | 2 + runningmate/mateapp/views.py | 29 ++++++- .../__pycache__/__init__.cpython-39.pyc | Bin 198 -> 163 bytes .../__pycache__/settings.cpython-39.pyc | Bin 2951 -> 2927 bytes .../__pycache__/urls.cpython-39.pyc | Bin 1147 -> 420 bytes .../__pycache__/wsgi.cpython-39.pyc | Bin 609 -> 338 bytes runningmate/runningmate/urls.py | 15 ---- runningmate/runningmate/wsgi.py | 9 --- 22 files changed, 160 insertions(+), 32 deletions(-) create mode 100644 runningmate/mateapp/forms.py create mode 100644 runningmate/mateapp/templates/mateapp/calendarDay.html create mode 100644 runningmate/mateapp/templates/mateapp/createDay_form.html create mode 100644 runningmate/mateapp/templates/mateapp/create_my_profile.html diff --git a/runningmate/db.sqlite3 b/runningmate/db.sqlite3 index 53f754c0fe9a9e1d95009bb2d0d9f3ae3a154671..1ac14921a76f27e46427621491b01765a70fe487 100644 GIT binary patch delta 682 zcmaix&u`LT0EX$B*|@}hn>T|YEbgFLU>{%U4@j0+3hNxBNGXi=g2Pg1%b=_bXfJHe zWY_5~JNh3irUw$Eaq*AvT6~^y*Xn7!~svUVg@

8=;aQ!o z?sgk(+gn=EYOQg9V3-}wthxT!En0#hJ1iP0%Pnn3dulAB?WV!oti6gLLNUn1P$~*j zX+)(FjME4u5#?HcWhhN^@dQmJDR>Z_x#0*tbu-u;4lY9A0{j4%!GiM{5V!CJ%(d{~ za&m7TCx}Tv9FK{~3!0cM9C|#*jQ8k-y~{w?)O&_yI{l83@^ptDIORQoyKkoTXu66k-yePV|_~ zikS8rb+g)Q3oY463s8hbsV#ZBn;I0$T}#kQ^0rZ-Wbe7rmny$qv#|vA=MPMZN(Ix? z0&$lhuR>r4d?ByEYcK^5!1|5tujHd8yny}BDeFfdy9Hdi_p=9yHP6u!XSQ;5^-af;ZU5Jfe znSno-{|^5o{_XtA{2u%sn*|GA^Qoy4atpf(voGW1{WBDr-Pdn-U(dMLftiipeLMRH ZMn!%(1_lOs+%~tn{b$_n_Md6j0ssybXkGvS diff --git a/runningmate/mateapp/__pycache__/__init__.cpython-39.pyc b/runningmate/mateapp/__pycache__/__init__.cpython-39.pyc index eabcf3a72a5da10136d94acdcc9698ee227f1fdf..4ff7158df72a990eee87c89b01692c8c804e9d20 100644 GIT binary patch delta 109 zcmX@aIG>R_k(ZZ?0SIo*+&z)oI`Wr`erR!OQL%n;YJOgNR(^h-zDsIxc1eDLeo$#% xUS?i;ZemHQei0HIB#>B8pdTNfnU`4-AFo$Xd5gm)H$SB`C)JJ-X!K{0`2admCCmT- delta 117 zcmbQwc!-fZk(ZZ?0SKn4Zkfn!9rrZ_$ac1h2`x@7Dvl}6$<8#4@y|6t3U6mldA)K=On81#c5y*sa%xO*W^PhqNq$~TP-$LXW?p)3Vo7RD5fU3DkXTR< IGqF()0Mei?A^-pY diff --git a/runningmate/mateapp/__pycache__/admin.cpython-39.pyc b/runningmate/mateapp/__pycache__/admin.cpython-39.pyc index a472a904cd5b41f93f80f9ac39029a251623f0b2..56cf0833cb29436abf4ac22255303d884c015275 100644 GIT binary patch delta 84 zcmaFOc!H5Pk(ZZ?0SIo*+?`}UkvG-)m!p1YacWVqesOAkUV2u3exANdYH@Z+et~{a bXQ$eSAXH4(^jwu%WYPAw{qDbC5xG>q}jOLZyAEK7}f zy&>uePhTAW%`98;W=ooN{3pO@-Vlv$P< z^LoRSx6M-(-p-uzdgYdw@cg3e;)2BF)R^MT+@!>k{JfZ;(!9LPy!70}lGKSid+mKQBEiKR-|3CAB!aB)>pE es5CDxGcP?iu_RT$2#F06NGvGO-(118oe2Q*$sYOu delta 122 zcmeC-TF=Fs$ji&c00h5$wj@Pt`XDFWdkC diff --git a/runningmate/mateapp/__pycache__/urls.cpython-39.pyc b/runningmate/mateapp/__pycache__/urls.cpython-39.pyc index cfb6f4235ddf196c3052e7b503e2337d0565264b..0a1ae8647968af1f718efc7d87dbfa020555e1ce 100644 GIT binary patch literal 370 zcmYjMOHRWu5Vi9)O)Ab27R?0^>Y{5Fd^Xu2ml>rgi5=Mq6^Gy;oPh&y2X9&R3J4@- zq%Jy^pWYjf-^}Rcav>;wzdpB03h~Y2JaQ6ix_(0d0%R`+*+?lMg1CiYc zgZ!Pj!W7hrUtk6c=55^MP~3~EJd%^BWJpFm?T*xxg}e&+peNMh*r-8wX4EYP<#+bL zipz~2DD$j)G@xA&A?^~}=wBu~)_1cpooRW>+MV&!*flp_jc-9+4;JPg RZ+JCd5|mQOBq}AHzkiS4Wmfu5`vI))bCl22IY1B?{uV z7;bSCXXKaXCT8YoGTvg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2`x@7Dvl}6$<8#4@y|6t3U6mldA)K=On81#c5y*sa%xO*W^PhqNq$~TP-$LXW?p)3Vo7RD5fU3DkXTR< Tlbe}dlvt9PpI00+u}2O7{^K(8 diff --git a/runningmate/mateapp/models.py b/runningmate/mateapp/models.py index 363e372..dd4aa56 100644 --- a/runningmate/mateapp/models.py +++ b/runningmate/mateapp/models.py @@ -1,15 +1,16 @@ +from statistics import mode from django.db import models from django.contrib.auth.models import User # Create your models here. -class Post(models.Model): - id = models.AutoField(primary_key=True) - title = models.CharField(max_length=200) - writer = models.ForeignKey(User,on_delete=models.CASCADE) - pub_date = models.DateTimeField() - body = models.TextField() - image = models.ImageField(upload_to = "post/", blank=True, null=True) +# class Post(models.Model): +# id = models.AutoField(primary_key=True) +# title = models.CharField(max_length=200) +# writer = models.ForeignKey(User,on_delete=models.CASCADE) + # pub_date = models.DateTimeField() + # body = models.TextField() + # image = models.ImageField(upload_to = "post/", blank=True, null=True) def __str__(self): return self.title @@ -17,6 +18,21 @@ def __str__(self): def summary(self): return self.body[:10] +class Post(models.Model): + userName = models.CharField(max_length=20) # 이름 입력 최대 20글자 + userAbility = models.CharField(max_length=20) # 이름 입력 최대 20글자 + writer = models.ForeignKey(User,on_delete=models.CASCADE) # 작성자 누군지 + pub_date = models.DateTimeField() + body = models.TextField() + image = models.ImageField(upload_to = "post/", blank=True, null=True) + def __str__(self): + return self.title + + def summary(self): + return self.body[:10] + + + class Comment(models.Model): content = models.TextField() writer = models.ForeignKey(User, on_delete=models.CASCADE) diff --git a/runningmate/mateapp/templates/mateapp/calendarDay.html b/runningmate/mateapp/templates/mateapp/calendarDay.html new file mode 100644 index 0000000..72b9db9 --- /dev/null +++ b/runningmate/mateapp/templates/mateapp/calendarDay.html @@ -0,0 +1,8 @@ + + +이전 페이지 + + + \ No newline at end of file diff --git a/runningmate/mateapp/templates/mateapp/createDay_form.html b/runningmate/mateapp/templates/mateapp/createDay_form.html new file mode 100644 index 0000000..533ad9f --- /dev/null +++ b/runningmate/mateapp/templates/mateapp/createDay_form.html @@ -0,0 +1,12 @@ +{% extends 'base.html' %} +{% block content %} + +

+ {% csrf_token %} + + {{form.as_p}} +
+
+ + +{% endblock %} \ No newline at end of file diff --git a/runningmate/mateapp/templates/mateapp/create_my_profile.html b/runningmate/mateapp/templates/mateapp/create_my_profile.html new file mode 100644 index 0000000..0110040 --- /dev/null +++ b/runningmate/mateapp/templates/mateapp/create_my_profile.html @@ -0,0 +1,13 @@ +{% extends 'base.html' %} +{% load static %} + +{% block content %} + +
+ {%csrf_token%} +

닉네임 :

+

선호 파트 :

+

선호시간대 :

+

MBTI :

+

나를 표현하는 해시태그

+
\ No newline at end of file diff --git a/runningmate/mateapp/urls.py b/runningmate/mateapp/urls.py index 24d02bc..38251d2 100644 --- a/runningmate/mateapp/urls.py +++ b/runningmate/mateapp/urls.py @@ -4,5 +4,7 @@ urlpatterns = [ path('mainpage',showmain, name = "showmain"), path('calendar',calendar, name = "calendar"), + path('detail/', detail, name = "detail"), # 아마 여기를 페이지 넘버별로 일정이 달라지는 식으로 구현하고 싶긴한데 .. path('', login, name="login"), + path('create_my_profile', create,name="create"), ] \ No newline at end of file diff --git a/runningmate/mateapp/views.py b/runningmate/mateapp/views.py index c1001b9..00ccdd5 100644 --- a/runningmate/mateapp/views.py +++ b/runningmate/mateapp/views.py @@ -1,9 +1,13 @@ from django.contrib import auth from django.contrib.auth import authenticate from django.contrib.auth.models import User -from django.shortcuts import render, redirect +from django.shortcuts import render, redirect, get_object_or_404 +from django.core.paginator import Paginator +from .models import Post + # Create your views here. def showmain(request): + posts = Post.objects.all() # models.py에 저장된 모든 객체를 posts 에 저장함 return render(request,'mateapp/mainpage.html') def login(request): @@ -12,5 +16,28 @@ def login(request): else: return render(request, 'mateapp/login.html') +def create(request): + new_post = Post() + new_post.userName = request.POST['userName'] + new_post.userAbility = request.POST['userAbility'] + new_post.body = request.POST['body'] + new_post.save() + return redirect('detail', new_post,id) + + +def detail(request, id): + post = get_object_or_404(Post, pk = id) + return render(request, 'mateapp/detail.html', {'post':post}) + def calendar(request): return render(request,'mateapp/calendar.html') + + +#일짜별 캘린더 페이지 네이터 +# def calendarDay(request): # 캘린더에 + 추가 하면 각 일자마다 페이지를 이동시켜버림 +# # posts = Post.objects.all() +# posts = Post.objects.filter().order_by('-date') # posts는 객체들의 목록임 +# paginator = Paginator(posts,1) # 하루씩 입력받아 페이지를 넘긴다는 뜻임 +# pagnum = request.GET.get('page') # 페이지에 해당하는 밸류의 키값을 반환하기 위해서 GET 요청을 함 +# posts = paginator.get_page(pagnum) # 페이지네이터에서 짜른 객체가 posts에 요청이 갈꺼고, 담길것임 +# return render(request, 'calenderDay.html', {'posts':posts}) \ No newline at end of file diff --git a/runningmate/runningmate/__pycache__/__init__.cpython-39.pyc b/runningmate/runningmate/__pycache__/__init__.cpython-39.pyc index b4249852fa75af1a473b89470eee7fc335c16626..822f8f673f788bab39ddaa7a9eee8fd1b81bbb09 100644 GIT binary patch delta 86 zcmX@cxR{YUk(ZZ?0SIo*+&z)o+Wwb^erR!OQL%n;YJOgNR(^h-zDsIxc1eDLeo$#% TUS?i;ZemHQei07##1(P?2+<$7 delta 149 zcmZ3?c#M%dk(ZZ?0SKn4Zkfn!UH>%$$ac1h2`x@7Dvl}6$<8#4@y|6t3U6mldA)K=On81#c5y*sa%xO*W^PhqNq$~TP-$LXW?p)3Vo7RD5e{~Id}dx| cNqoFsLFFwDo80`A(wtN~Mxd>qftZm20CUVY{Qv*} diff --git a/runningmate/runningmate/__pycache__/settings.cpython-39.pyc b/runningmate/runningmate/__pycache__/settings.cpython-39.pyc index 1ef7e31b27505f8ccd379d31d5c5635af6069eda..855e3914f3a0d6ea4af30a71a2ec8f136218e790 100644 GIT binary patch delta 145 zcmZn{e=o+D$ji&c00g&Y?oOJe)-O)Y&r8qB&(G6$NiEJU b$uH0kD$UEw%uCNrEJ@Wb!oi;Wm#Yf^S|Tvc delta 168 zcmaDa)-KMM$ji&c00dp(TavT{Hu7;Z$}307r>LZ;rl_SerKqQ9WHP2`&SA=Aj8aHp z4rb8Q+HAp?#=dza$6v;zuNgp{&Q>v@#i>QbF~vFAnT9d`d8sZ%nPsUluQyD2+dNg_ y?aV2!S8j<3&o9a@E=WvHjVaE|O-d}u&x;8v&CAQoOV3R#NsTGO!Jhn-s|x^eH$2t= diff --git a/runningmate/runningmate/__pycache__/urls.cpython-39.pyc b/runningmate/runningmate/__pycache__/urls.cpython-39.pyc index 2d63f625e8306ccdea18fbb8445d9d88b5a60d2d..4b5b3c32554df2072f38d43100707832791be621 100644 GIT binary patch delta 258 zcmey(v4pukk(ZZ?0SFe&+MV3SW+3Y*t0mAnSgB8RF)LBW=1fZ9mwVYvD2BOI8&H8 zgBd3CGDkD}X>v{OW_F9X#a&vIQ;=9vl3J8kypo}a2WTsp_~oJ>TAW%`tY4g(pO>DM xpP#4il3JWyl3$=7RGOEUnU|iMSdyw=go8afkVQ-YWEc;l03#1G49X#}pI}a1q>(VhsR9HVOiV%`jZH{Zq|S}qHeGB-wli3-J98Tc z{)F8?+Fz3^Cp7KIjRVhaDhd)3IEwS^Jb&+d-+RXE>wyE~&e8SoOVe?_n#J;H!{Q0N zY6KH;`VMhPBX?P&-*AoH%$v;Xd#u%O*|nFiFu(7+4)sWjHm2?A>O}+W71|>Hg=_6L z*sHZ2P=6YbHPZRe9DDsWvi`;iH?VFvjx0IP_?Tf$(edF+v?ur|8r6s4xh98gFLbe7R~Dnk20A|@n786OD=kN|;-oMJ_hqO=zv7!$1v z)r(^yQWcRY=3`MvF{P=FQo&-%;|I~bSc@V{RcxGN2(RMc`FqR&OZ9^NlBX8hhP9x( z5qe4p!W?C+5K{LL8cD$rJ0IYps5j>{t^fVn-=+)+EM*8sA=$}xx4Tp4H4%*NAdVS* z)HQZD4EA!Y)ZHN@MwU?j#zN=`m4--U887I(0IdIEWBenm1_oq1{DaW}PxF#MB|!um z&!m<@F&FwASYZ%Qf$|t%x*eiXEoE;m*Ss8&5qv?i_T90f{4?8OF2*qkxQNs>8y2@4 zhQT*zawl}F7A7p?VWaYl;+0=}n?F{l*@|_DD`(a*4QdoL+-9pdO-0GIif0|1=eX39 z`HvL{lkvD}*)ITjrfjdmPUQ~<&~bx7f1^$kw9zsfO1J|~wYHSGgbV6O&usg3RM|2s zPi2}`o?#$;dupj|t{k~(&Y9^ufoZRo94jhSqVm&hH+jwJGnt*yN005 zFsHCA1o4=f8KPKI7=sx!Str{v`ZBUjp2Fzh!3oq{1R{R9=!X`k78UCkr{?FSXXWST r>AR#BXP4v`=m(YNKEZ)Pqt?g<6;Av!@Y5Z${(jfbYQvzW$0(42ymhzN>eA%Y@8SV%UvlVs!G?y~pe&ma6dO9LLZs%TW_d&Nf+gb96lQQ7}4`ome ze9y@+&6RTj!Jw6Y7~^?9_85AUyCUUr9v+hU@yqw<_;6 Date: Thu, 30 Jun 2022 00:57:00 +0900 Subject: [PATCH 2/2] featurev1 --- runningmate/db.sqlite3 | Bin 237568 -> 237568 bytes .../mateapp/__pycache__/models.cpython-39.pyc | Bin 1292 -> 1549 bytes .../mateapp/__pycache__/urls.cpython-39.pyc | Bin 370 -> 460 bytes .../mateapp/__pycache__/views.cpython-39.pyc | Bin 1189 -> 1433 bytes runningmate/mateapp/models.py | 29 +++++++----------- .../templates/mateapp/calendarDay.html | 4 +-- .../mateapp/templates/mateapp/login.html | 2 +- runningmate/mateapp/views.py | 16 +++++----- 8 files changed, 22 insertions(+), 29 deletions(-) diff --git a/runningmate/db.sqlite3 b/runningmate/db.sqlite3 index 1ac14921a76f27e46427621491b01765a70fe487..2c2a5bbb7b97ad1f8f06341012259141c0cce0cc 100644 GIT binary patch delta 1373 zcmah}+iN3b6rV|_F{AB#U0tiSQq!pH3MQHRWFktxwn>}XTP{u0vJi8bOzxB0OfoH! zTI-AZV$DNDP?lx!MOa+2wg@5%vVVcBu%J@heOT88_eJ!n>!gLYV%3*{Z_e*`e&;*q zcfO4q#KsNcgJHC_{rm*ly7tyh2a311FPoljfBLz}+=5Q4aef#_&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z%QMVl%zIebr~09XmtKA#A`zp8cSIsm%!guxI%U@XvDN1KJvc;d(za~Ov@`v#E>^==HYf@A8B=tf8;m11Dx#ety4}Ojv^{n* z^aCeGhxGc@|0duZTmB*7YafIn@`W;jjD-Wj(Gw6#&-Qk!zA6}=`l5f??XYNui`u;u<%r}$L4nBq3))8RQ9!lcKi lFQ*NDpx3gGwm*MYKsNqz;O1BKt7+OyCC;+gi@n4BzX4xNQfvSK delta 744 zcmYjP%Wl&^6!mz<_Skte4evIED$s=mDgriuDxOj!gouhLLh{CPIzve6M>KX85$x!a zETUNl~E9I z71_)3VjqYrBQZ!KF$oX(Wd1|$m|Gh@R_=HdXAujFOj*4+N)HuD$8p^Co3ewq?wR_q z?$dFR?GAX%lsRC^ef}X5i>Xx%ikK^JHxqo&Phawh!15U1Z!6Nv*hG0RlBmy@xuD+X zCx&PNr)bT7cdiKnt_^=)1)!)3qk$-laz%bJZ#?u-*GJ+Ute-%0avr~559S#z_Oor)6Q=xTZSH9iWxdkRr&K79F4_<+ b_xyL(zaon6z;heN{1G}+g3gmBrI_MB>~pBB diff --git a/runningmate/mateapp/__pycache__/urls.cpython-39.pyc b/runningmate/mateapp/__pycache__/urls.cpython-39.pyc index 0a1ae8647968af1f718efc7d87dbfa020555e1ce..ebd4dce0d6a15cb901ca9f2fe39b21c92807365e 100644 GIT binary patch delta 219 zcmeywbcR_wk(ZZ?0SJ;V?oQgo$iVOz#6bp}K#l_t7spK0wpU7JOyN#tPvJ>n?_~zE zc~d!3_(1G*)+o*t{$K`8fr%w<4psaqsU?Y-Ir=u4c_mhvDR#HmAOg1-Zn5U%r)TCx z2__e%CYGee=T^oS6y>L7=A_e;x427-atablN>YpRidQle@dL$*_$Q|@h6wNgnLLaf Mj4Vt%j6nDo0L9fBxBvhE diff --git a/runningmate/mateapp/__pycache__/views.cpython-39.pyc b/runningmate/mateapp/__pycache__/views.cpython-39.pyc index 5969e1fb32ee70a45cc0b1f97fd5d052b98c6c03..fb4cd56f330b3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OQ1m;EuhSsCxmsHm;M zC6dqk{X_I^8)tXtm2rl;Hj-f9HYJB&GnNUo*5DQUDxm!NCVC#x>1^_^nbCzUB;+!c zRIA^EcOZnAF5aZvUbfbL5ko4@+5*0tJ{d^{=Dtk6&FmscHv Pn7YQ$f!L9b^rZ6(UxJe) diff --git a/runningmate/mateapp/models.py b/runningmate/mateapp/models.py index dd4aa56..4db4b1a 100644 --- a/runningmate/mateapp/models.py +++ b/runningmate/mateapp/models.py @@ -4,19 +4,19 @@ # Create your models here. -# class Post(models.Model): -# id = models.AutoField(primary_key=True) -# title = models.CharField(max_length=200) -# writer = models.ForeignKey(User,on_delete=models.CASCADE) - # pub_date = models.DateTimeField() - # body = models.TextField() - # image = models.ImageField(upload_to = "post/", blank=True, null=True) +class Post(models.Model): + id = models.AutoField(primary_key=True) + title = models.CharField(max_length=200) + writer = models.ForeignKey(User,on_delete=models.CASCADE) + pub_date = models.DateTimeField() + body = models.TextField() + image = models.ImageField(upload_to = "post/", blank=True, null=True) -def __str__(self): - return self.title + def __str__(self): + return self.title -def summary(self): - return self.body[:10] + def summary(self): + return self.body[:10] class Post(models.Model): userName = models.CharField(max_length=20) # 이름 입력 최대 20글자 @@ -32,10 +32,3 @@ def summary(self): return self.body[:10] - -class Comment(models.Model): - content = models.TextField() - writer = models.ForeignKey(User, on_delete=models.CASCADE) - post = models.ForeignKey(Post ,on_delete=models.CASCADE, related_name ='comments') - created_at = models.DateTimeField(auto_now_add=True) - update_at = models.DateTimeField(auto_now=True) diff --git a/runningmate/mateapp/templates/mateapp/calendarDay.html b/runningmate/mateapp/templates/mateapp/calendarDay.html index 72b9db9..c7aaf73 100644 --- a/runningmate/mateapp/templates/mateapp/calendarDay.html +++ b/runningmate/mateapp/templates/mateapp/calendarDay.html @@ -1,8 +1,8 @@ +여기 아래마다 이전 페이지 - \ No newline at end of file +{% endblock %} \ No newline at end of file diff --git a/runningmate/mateapp/templates/mateapp/login.html b/runningmate/mateapp/templates/mateapp/login.html index 0ca4ff6..bc61d8c 100644 --- a/runningmate/mateapp/templates/mateapp/login.html +++ b/runningmate/mateapp/templates/mateapp/login.html @@ -13,6 +13,6 @@

회원가입 - 구글 + 구글 \ No newline at end of file diff --git a/runningmate/mateapp/views.py b/runningmate/mateapp/views.py index 00ccdd5..44fae6e 100644 --- a/runningmate/mateapp/views.py +++ b/runningmate/mateapp/views.py @@ -33,11 +33,11 @@ def calendar(request): return render(request,'mateapp/calendar.html') -#일짜별 캘린더 페이지 네이터 -# def calendarDay(request): # 캘린더에 + 추가 하면 각 일자마다 페이지를 이동시켜버림 -# # posts = Post.objects.all() -# posts = Post.objects.filter().order_by('-date') # posts는 객체들의 목록임 -# paginator = Paginator(posts,1) # 하루씩 입력받아 페이지를 넘긴다는 뜻임 -# pagnum = request.GET.get('page') # 페이지에 해당하는 밸류의 키값을 반환하기 위해서 GET 요청을 함 -# posts = paginator.get_page(pagnum) # 페이지네이터에서 짜른 객체가 posts에 요청이 갈꺼고, 담길것임 -# return render(request, 'calenderDay.html', {'posts':posts}) \ No newline at end of file +# 일짜별 캘린더 페이지 네이터 +def calendarDay(request): # 캘린더에 + 추가 하면 각 일자마다 페이지를 이동시켜버림 + # posts = Post.objects.all() + posts = Post.objects.filter().order_by('-date') # posts는 객체들의 목록임 + paginator = Paginator(posts,1) # 하루씩 입력받아 페이지를 넘긴다는 뜻임 + pagnum = request.GET.get('page') # 페이지에 해당하는 밸류의 키값을 반환하기 위해서 GET 요청을 함 + posts = paginator.get_page(pagnum) # 페이지네이터에서 짜른 객체가 posts에 요청이 갈꺼고, 담길것임 + return render(request, 'calenderDay.html', {'posts':posts}) \ No newline at end of file