8000 Issue #1 solved! · moktadirul-raju/DjangoBlog@db1b986 · GitHub
[go: up one dir, main page]

Skip to content

Commit db1b986

Browse files
committed
Issue #1 solved!
1 parent 1942644 commit db1b986

File tree

10 files changed

+18
-18
lines changed

10 files changed

+18
-18
lines changed

blog/__pycache__/urls.cpython-37.pyc

1 Byte
Binary file not shown.

blog/__pycache__/views.cpython-37.pyc

0 Bytes
Binary file not shown.

blog/urls.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
path('logout/', views.user_logout, name='logout'),
1111
path('sign-up/', views.registration, name='sign-up'),
1212
path('<int:year>/', views.archeive_posts, name='archeive_post'),
13-
path('<int:year>/<int:month>/<int:day>', views.archeive_posts_by_date, name='archeive_date'),
13+
path('<int:year>/<int:month>/<int:day>/', views.archeive_posts_by_date, name='archeive_date'),
1414
path('tag/<str:tag>/', views.archeive_posts_by_tag, name='archeive_tag'),
1515
path('category/<str:category>/', views.archeive_posts_by_category, name='archeive_category'),
1616
path('author/<str:username>/', views.archeive_posts_by_author, name='archeive_author'),

blog/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def index(request):
3333
if category not in categories:
3434
categories.append(category)
3535

36-
paginator = Paginator(post_list, 2) # Show 2 posts per page
36+
paginator = Paginator(post_list, 5) # Show 5 posts per page
3737
page = request.GET.get('page')
3838
posts = paginator.get_page(page)
3939

db.sqlite3

0 Bytes
Binary file not shown.

media/featured_images/1st.jpg

615 KB
Loading

templates/blog/archeive.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
{% if posts %}
66
{% for post in posts %}
77
<div class="post">
8-
<h2><a href="blog/posts/{{post.id}}"> {{ post.title}} </a></h2>
8+
<h2><a href="/blog/posts/{{post.id}}"> {{ post.title}} </a></h2>
99
<ul>
10-
<li>By <a href="blog/author/{{post.author}}">{{ post.author}}</a></li>
11-
<li><a href="blog/{{post.published_date.year}}/{{post.published_date.month}}/{{post.published_date.day}}"> <i class="fa fa-clock-o" aria-hidden="true"></i> {{ post.published_date }}</a></li>
10+
<li>By <a href="/blog/author/{{post.author}}">{{ post.author}}</a></li>
11+
<li><a href="/blog/{{post.published_date.year}}/{{post.published_date.month}}/{{post.published_date.day}}"> <i class="fa fa-clock-o" aria-hidden="true"></i> {{ post.published_date }}</a></li>
1212

1313
</ul>
1414
<hr>
1515
<p>{{post.content}}</p>
1616

17-
<button class="btn"><a href="blog/posts/{{post.id}}">Read More</a></button>
17+
<button class="btn"><a href="/blog/posts/{{post.id}}">Read More</a></button>
1818

1919
</div>
2020
{% endfor %}

templates/blog/base.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ <h2>Recent Posts</h2>
6868
{% if posts %}
6969
{% for post in posts %}
7070
<ul>
71-
<li> <a href="blog/posts/{{post.id}}">{{post.title}}</a> </li>
71+
<li> <a href="/blog/posts/{{post.id}}">{{post.title}}</a> </li>
7272

7373
</ul>
7474
{% endfor %}
@@ -81,15 +81,15 @@ <h2>Recent Posts</h2>
8181
<h2>Archeives</h2>
8282
<ul>
8383
{% for year in years %}
84-
<li> <a href="blog/{{ year}}" />{{ year }}</a> </li>
84+
<li> <a href="/blog/{{ year}}" />{{ year }}</a> </li>
8585
{% endfor %}
8686
</ul>
8787
</div>
8888
<div class="widget">
8989
<h2>Categories</h2>
9090
<ul>
9191
{% for category in categories %}
92-
<li> <a href="blog/category/{{ category }}" />{{ category }}</a> </li>
92+
<li> <a href="/blog/category/{{ category }}" />{{ category }}</a> </li>
9393
{% endfor %}
9494

9595

@@ -100,7 +100,7 @@ <h2>Categories</h2>
100100
<h2>Tags</h2>
101101
<ul>
102102
{% for tag in tags %}
103-
<li> <a href="blog/tag/{{ tag }}" />{{ tag }}</a> </li>
103+
<li> <a href="/blog/tag/{{ tag }}" />{{ tag }}</a> </li>
104104
{% endfor %}
105105

106106

templates/blog/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
{% if posts %}
66
{% for post in posts %}
77
<div class="post">
8-
<h2><a href="blog/posts/{{post.id}}"> {{ post.title}} </a></h2>
8+
<h2><a href="/blog/posts/{{post.id}}"> {{ post.title}} </a></h2>
99
<ul>
10-
<li>By <a href="blog/author/{{post.author}}">{{ post.author}}</a></li>
11-
<li><a href="blog/{{post.published_date.year}}/{{post.published_date.month}}/{{post.published_date.day}}"> <i class="fa fa-clock-o" aria-hidden="true"></i> {{ post.published_date }}</a></li>
10+
<li>By <a href="/blog/author/{{post.author}}">{{ post.author}}</a></li>
11+
<li><a href="/blog/{{post.published_date.year}}/{{post.published_date.month}}/{{post.published_date.day}}"> <i class="fa fa-clock-o" aria-hidden="true"></i> {{ post.published_date }}</a></li>
1212

1313
</ul>
1414
<hr>
1515
<p>{{post.content}}</p>
1616

17-
<button class="btn"><a href="blog/posts/{{post.id}}">Read More</a></button>
17+
<button class="btn"><a href="/blog/posts/{{post.id}}">Read More</a></button>
1818

1919
</div>
2020
{% endfor %}

templates/blog/single.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
{% if post %}
88
<h2>{{post.title}}</h2>
99
<ul>
10-
<li>By <a href="blog/posts/{{post.author}}">{{post.author}}</a></li>
11-
<li><a href="blog/posts/{{post.published_date.date}}"> <i class="fa fa-clock-o" aria-hidden="true"></i> {{ post.published_date}}</a></li>
10+
<li>By <a href="/blog/author/{{post.author}}">{{post.author}}</a></li>
11+
<li><a href="/blog/posts/{{post.published_date.date}}"> <i class="fa fa-clock-o" aria-hidden="true"></i> {{ post.published_date}}</a></li>
1212

1313
</ul>
1414
<hr>
@@ -23,8 +23,8 @@ <h2>{{post.title}}</h2>
2323
<li style="float: right"><a href="#">Next Post</a></li>
2424
</ul>
2525
-->
26-
<p><b>Categories:</b><a href="blog/{{ tag }}" />{{ post.category }}</a></p> <br>
27-
<p><b>Tags:</b><a href="blog/{{ category }}" />{{ post.tag }}</a></p>
26+
<p><b>Categories:</b><a href="/blog/category/{{ post.category }}" />{{ post.category }}</a></p> <br>
27+
<p><b>Tags:</b><a href="/blog/tag/{{ post.tag }}" />{{ post.tag }}</a></p>
2828

2929
<!--
3030
Share option will be add in next version

0 commit comments

Comments
 (0)
0