Skip to content

Commit

Permalink
add post template
Browse files Browse the repository at this point in the history
  • Loading branch information
milenasuarez committed Feb 12, 2017
1 parent 70aa5ed commit 446078f
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 2 deletions.
2 changes: 1 addition & 1 deletion blog/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

ALLOWED_HOSTS = ['mile777.pythonanywhere.com']
ALLOWED_HOSTS = ['mile777.pythonanywhere.com','localhost']


# Application definition
Expand Down
3 changes: 2 additions & 1 deletion blog/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@
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 url, include
from django.contrib import admin

urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'', include('blogTest.urls')),
]
24 changes: 24 additions & 0 deletions blogTest/templates/blog/post_list.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>The first gjango applications</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 fermentum massa 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>
6 changes: 6 additions & 0 deletions blogTest/urls.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from django.conf.urls import url
from blogTest import views

urlpatterns = [
url(r'^$', views.post_list, name='post_list'),
]
2 changes: 2 additions & 0 deletions blogTest/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from django.shortcuts import render

# Create your views here.
def post_list(request):
return render(request, 'blog/post_list.html', {})

0 comments on commit 446078f

Please sign in to comment.