Done first view
authorNeil Smith <neil.git@njae.me.uk>
Wed, 5 Oct 2016 09:25:07 +0000 (10:25 +0100)
committerNeil Smith <neil.git@njae.me.uk>
Wed, 5 Oct 2016 09:25:07 +0000 (10:25 +0100)
.gitignore
blog/templates/blog/post_list.html [new file with mode: 0644]
blog/urls.py [new file with mode: 0644]
blog/views.py
mysite/urls.py

index 42365e057f2699a99fedb87a7a817b501adf6776..f6cc5da1e91c4461205bb6fc92c6932f02da7a45 100644 (file)
@@ -49,3 +49,7 @@ nosetests.xml
 
 # Virtual environment
 djangogirls
+
+# Django static files
+/static
+.DS_Store
diff --git a/blog/templates/blog/post_list.html b/blog/templates/blog/post_list.html
new file mode 100644 (file)
index 0000000..aa9d1d5
--- /dev/null
@@ -0,0 +1,23 @@
+<!DOCTYPE html>
+<html>
+<head>
+       <title>Neil's blog</title>
+</head>
+<body>
+
+<div>
+       <h1><a  href="">Django  Girls   Blog</a></h1>
+</div>
+<div>
+       <p>published:   14.06.2014,     12:14</p>
+       <h2><a  href="">My      first   post</a></h2>
+       <p>Aenean       eu      leo     quam.   Pellentesque    ornare  sem     lacinia quam    venenatis       vestibulum.     Donec   id      elit    non     mi      porta   gravida at      eget    metus.  Fusce   dapibus,        tellus  ac      cursus  commodo,        tortor  mauris  condimentum     nibh,   ut      rmentum mass a  justo   sit     amet    risus.</p>
+</div>
+<div>
+       <p>published:   14.06.2014,     12:14</p>
+       <h2><a  href="">My      second  post</a></h2>
+       <p>Aenean       eu      leo     quam.   Pellentesque    ornare  sem     lacinia quam    venenatis       vestibulum.     Donec   id      elit    non     mi      porta   gravida at      eget    metus.  Fusce   dapibus,        tellus  ac      cursus  commodo,        tortor  mauris  condimentum     nibh,   ut      f.</p>
+</div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/blog/urls.py b/blog/urls.py
new file mode 100644 (file)
index 0000000..eecfb5f
--- /dev/null
@@ -0,0 +1,6 @@
+from django.conf.urls import url
+from . import views
+
+urlpatterns = [
+       url(r'^$', views.post_list, name='post_list'),
+]
\ No newline at end of file
index 91ea44a218fbd2f408430959283f0419c921093e..299ca351e387113b9ede22567be45038cfe9a309 100644 (file)
@@ -1,3 +1,4 @@
 from django.shortcuts import render
 
-# Create your views here.
+def post_list(request):
+       return render(request, 'blog/post_list.html', {})
index bc15726766deaa04a45f108024517bfa8e64736b..df6b88dbb33e01a56067d501095c85dcf22a6bae 100644 (file)
@@ -13,9 +13,10 @@ Including another URLconf
     1. Import the include() function: from django.conf.urls import url, include
     2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
 """
-from django.conf.urls import url
+from django.conf.urls import include, url
 from django.contrib import admin
 
 urlpatterns = [
     url(r'^admin/', admin.site.urls),
+    url('', include('blog.urls')),
 ]