-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(As you can see, I think I'm going to resist the temptation to pass locals() as a template context; yes, it's cool, but it is written that Explicit Is Better Than Implicit.)
- Loading branch information
1 parent
5762d6f
commit 20c227f
Showing
6 changed files
with
38 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{% extends "base.html" %} | ||
|
||
{% block subtitle %}{{ post.title }}{% endblock %} | ||
|
||
{% block content %} | ||
<h2>Post #{{ post.pk }}</h2> | ||
|
||
<div class="post-content" data-id="{{ post.pk }}"> | ||
{{ post.content }} | ||
</div> | ||
|
||
<div id="comments"> | ||
<h4>{{ post.comment_set.count }} comments</h4> | ||
{% for comment in post.comment_set.all %} | ||
<hr> | ||
<div class="comment" data-id="{{ comment.pk }}"> | ||
{{ comment.content }} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
from django.conf.urls import patterns, include, url | ||
|
||
urlpatterns = patterns('', | ||
urlpatterns = patterns( | ||
'', | ||
url(r'^$', 'core.views.home', name='home'), | ||
url(r'^(\d+)', 'core.views.show_post', name="show_post") | ||
) |