Skip to content

Commit 5bfb9e7

Browse files
mariomario
authored andcommitted
첫 뷰 생성
1 parent aaac380 commit 5bfb9e7

File tree

6 files changed

+14
-1
lines changed

6 files changed

+14
-1
lines changed

blog/templates/blog/post_list.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<h1>Momo2 </h1>
2+
3+
<p> 안녕하세요 </p>

blog/urls.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from django.conf.urls import url
2+
from . import views
3+
4+
urlpatterns = [
5+
url(r'^$', views.post_list),
6+
]
7+

blog/views.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
from django.shortcuts import render
22

33
# Create your views here.
4+
def post_list(request):
5+
return render(request, 'blog/post_list.html')
10 Bytes
Binary file not shown.
51 Bytes
Binary file not shown.

momo2/urls.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@
1313
1. Import the include() function: from django.conf.urls import url, include
1414
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
1515
"""
16-
from django.conf.urls import url
16+
from django.conf.urls import include, url
1717
from django.contrib import admin
1818

1919
urlpatterns = [
2020
url(r'^admin/', admin.site.urls),
21+
url(r'^blog/', include('blog.urls')),
2122
]

0 commit comments

Comments
 (0)